开发者

this code doesn't work in IE7 could anyone help me?

开发者 https://www.devze.com 2023-03-20 04:05 出处:网络
$(\"#menu ul li\").click(function(){ var colorBorder = $(thi开发者_如何学JAVAs).parent(\"ul\").find(\"li:hover\").css(\"border-bottom-color\");
$("#menu ul li").click(function(){
var colorBorder = $(thi开发者_如何学JAVAs).parent("ul").find("li:hover").css("border-bottom-color");
alert(colorBorder)
});

it works in chrome, opera, firefox, safari, ie9, ie8 but doesn't work in IE7, why?? i think is "li:hover".

http://jsfiddle.net/58sqR/3/


To me, it looks like

$(this).parent("ul").find("li:hover")

will return the same element as

$(this)

Since clicking a li also means hovering over it. Have you tried just using

var colorBorder = $(this).css("border-bottom-color");
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号