mouseenter, mouseleave in Firefox

╄→尐↘猪︶ㄣ 提交于 2019-12-11 02:59:29

问题


I'm facing a strange issue in Firefox 16.

In a div I'm fading in on a mouseenter (and fade out on mouseleave) event there is a select Tag embedded. When I move the mouse over the options the div fades out and in and so on. But there is no chance to select a option.

This does not happen in Chrome. Has anyone an idea why this is happening and how to fix it?

Fiddle: http://jsfiddle.net/sCmnd/2/


回答1:


Try that: http://jsfiddle.net/sCmnd/3/ . I tested it on Firefox and it worked.

mouseleave:function(evt) {
    if (evt.target.nodeName.toLowerCase() !== "select") {
        $('div.fade').fadeOut();
    }
}

For some reason mouseleave triggers on select element, but this doesn't allow fadeout when mouseleave is triggered by select element.



来源:https://stackoverflow.com/questions/13359545/mouseenter-mouseleave-in-firefox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!