$("#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");
精彩评论