开发者

How can I animate text colors using jQuery?

开发者 https://www.devze.com 2022-12-15 07:48 出处:网络
$(document).ready(function(){ $(\'a.nav_menu\') .css( {backgroundPosition: \"0 0\"} ) .mouseover(function(){
$(document).ready(function(){
    $('a.nav_menu')
        .css( {backgroundPosition: "0 0"} )
        .mouseover(function(){
            $(this).animate({
            backgroundPosition:"(-650px 0)",
            'color': '#000000'
        }, {duration:700})
        })
        .mouseout(function(){
            $(this).animate(开发者_如何转开发{backgroundPosition:"(0px 0)"}, {duration:900, complete:function(){
                $(this).css({backgroundPosition: "0 0"})
            }})
        })
});

What is wrong with this? The text color doesn't change.


You need to either use jQuery UI effects or the color animation plugin to animate colors.


You need to use this plugin to animate colours.

0

精彩评论

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