jQuery动画颜色变化 [英] jQuery animate color change

查看:133
本文介绍了jQuery动画颜色变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将链接颜色从当前颜色设置为其他颜色。

I'm trying to animate a link color change from the current color to an other color.

$(window).load(function(){
    $('.article-preview h1 a').hover(function(){
        $(this).animate({
            color: #ffffff
        }, 1500);
    });
});

由于某种原因,它不起作用。我正在使用 jQuery颜色插件

For some reason it's not working. I'm using the jQuery color plugin.

推荐答案

你需要将一个十六进制三元组包装成一个字符串,改变这个:

You need to wrap the hex triplet in a string, change this:

color: #ffffff

到此:

color: "#ffffff"

这篇关于jQuery动画颜色变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆