我正在尝试为标签获得简单的jQuery颜色悬停效果。您可以在此jsFiddle中使其无法正常工作。另外,我如何获得缓和效果呢?谢谢。
$(document).ready(function() {
var origColor = $("#links-top-contact").children('a').css("color");
$("links-top-contact").children('a').hover(function() {
$(this).css('color' , 'blue');
$("links-top-contact").children('a').hover(function() {
$(this).css(origColor);
});
});
});
答案 0 :(得分:3)
$(document).ready(function() {
var origColor = $("#links-top-contact a").css("color");
$("#links-top-contact a").hover(function() {
$(this).css({color:'blue'});
},function() {
$(this).css({color:origColor});
});
});
更新了小提琴 http://jsfiddle.net/uHYVf/