jQuery .hover效果'color'无法正常工作

时间:2011-08-10 07:34:45

标签: javascript jquery css

我正在尝试为标签获得简单的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); 
            });
        });
    });

1 个答案:

答案 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/

相关问题