How to enable hover on a div for IE6 using jquery in minmal code?

元气小坏坏 提交于 2019-12-11 02:09:32

问题


I just want to implement hover on a single div(for IE 6). what is the simplest , lightest, solution in jquery?

<div class="hoverforie">

</div>

i will add this script in IE condition comment.

Thanks in advance.


回答1:


Use hover event

$(".hoverforie").hover(
      function () {
        // do your code for mouse over
      }, 
      function () {
        // do your code for mouse out
      }
    );



回答2:


And if you just want to apply it specifically for IE6... (although I think the methods are deprecated)

if ($.browser.msie && $.browser.version=="6.0")
{
    ...apply the hover function from @adamantium
}


来源:https://stackoverflow.com/questions/1900768/how-to-enable-hover-on-a-div-for-ie6-using-jquery-in-minmal-code

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