css : li hover doesn't work in internet explorer 6

725 ワード

Q:  If you try to hover the 'test 2' link, the dropdown menu will appear. the problem in IE 6, any idea how to make this dropdown menu work in IE 6?
A1: In IE 6,  :hover  only works on  a  tags for CSS. If you want hover effects for IE 6, they'll have to be done in Javascript.
A2: you could use some JS to work around.
$(function(){
    $('.link ul li').hover(
        function(){
          $(this).addClass('hover');  
        },function(){
            $(this).removeClass('hover');
    });
});

http://jsfiddle.net/hMr7h/1/
引用:http://stackoverflow.com/questions/6309723/css-li-hover-doesnt-work-in-internet-explorer-6