简体   繁体   中英

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

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.

Use hover event

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

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
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM