jQuery的mouseover/out功能仅在Firefox中的单击事件后才起作用 [英] jquery's mouseover/out function only works after click-event in Firefox
问题描述
在我的html中的跨度上创建mouseover/out动作时,直到我第一次单击该元素为止,似乎没有与该链接的交互;之后,over/out事件几乎同时触发.
When creating a mouseover/out action on an span in my html it appeared that there is no interaction with the link, up until I first click the element; after which the over/out events are almost simultanuously fired.
简单的javascript可以在Chrome和FirefoxDeveloperEdition中使用;但是新的量子版本显示了这种奇怪的行为.
The simple javascript works both in Chrome and FirefoxDeveloperEdition; but the new quantum release displays this strange behaviour.
还有其他人遇到这种情况吗?
Anybody else experiencing this?
$(".item")
.mouseover(function(ev){
console.log('over');
})
.mouseout(function(ev) {
console.log('out');
})
.click(function (ev) {
console.log('click');
})
<span class="item">click me</span>
推荐答案
发现了问题.感谢您的思考,您的@delinear言论使我走上了正确的道路.
Found the issue. Thanks for thinking along, your remark @delinear set me on the right path.
我当时正在浏览器的响应模式下工作……显然,它不会触发mouseover/mouseout事件:(
I was working in the responsive mode of the browser... apparently it then doesn't fire the mouseover/mouseout events :(
这篇关于jQuery的mouseover/out功能仅在Firefox中的单击事件后才起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!