animate对颜色设置不起作用
今天了解了一下stop的使用方法,但是实例中加入color:red的时候,动画效果没有实现,具体实例如下:
http://jsbin.com/fezaroyene/edit?html,js,output
查看animate的使用方法,发现只能使用数字值

若想实现颜色变化的话,需要加入插件:
https://github.com/jquery/jquery-color
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
<script src="jquery-color/jquery.color.js"></script><!--引入jquery.color.js插件-->
<div id="animater">
stop()方法测试
</div>
<div id="button">
<input type="button" id="button1" value="stop()"/>
<input type="button" id="button2" value="stop(true)"/>
<input type="button" id="button3" value="stop(false,true)"/>
<input type="button" id="button4" value="stop(true,true)"/> </div>
//为了看效果,随意写的动画
$('#animater').animate({
'right':-400
}, 3000)
.animate({'font-size':'16px'},'normal')
.animate({'font-size':'26px'},'normal')
.animate({'font-size':'36px'},'normal')
.animate({'opacity':0},'normal')
.animate({'opacity':1},'normal')
.animate({'left':'200px','font-size':'16px','color':'red'},'normal');
// 点击不同的button执行不同的操作 $('#button1').click(function(){
//默认参数是false,不管写一个false还是两个false还是没写false效果一样
$('#animater').stop();
});
$('#button2').click(function(){
//第二个参数默认false
$('#animater').stop(true);
});
$('#button3').click(function(){
$('#animater').stop(false,true);
});
$('#button4').click(function(){
$('#animater').stop(true,true);
});
animate对颜色设置不起作用的更多相关文章
- scale相关设置—颜色设置
颜色设置,在R的可视化中,应该算是相对比较重要的一项内容,如何把握颜色,很大程度上影响图形的展现效果. 在ggplot的scale设置中,颜色相关的函数较多: scale_fill/colour_hu ...
- NavigationBar的显隐和颜色设置
[self.navigationController setNavigationBarHidden:NO animated:NO]; self.navigationController.navigat ...
- [转]保护眼睛的Windows和IE、Firefox、谷歌等浏览器颜色设置
保护眼睛的Windows和IE.Firefox.谷歌等浏览器颜色设置 长时间在电脑前工作,窗口和网页上的白色十分刺眼,眼睛很容易疲劳,也容易引起头痛,其实我们可以通过设置Windows窗口和软件的颜 ...
- 在Visual Studio 2012 Blue theme下使用Dark theme的文本编辑器颜色设置
Visual Studio 2012 默认提供了3种color theme: blue,light,和dark.其中dark的文本编辑器颜色设定很爽,可是整个菜单项加上一些小的窗口如Find Resu ...
- Win7下如何设置护眼的电脑豆沙绿界面?保护眼睛的颜色设置教程
关爱心灵的窗户——眼睛! 随着科技发展,使用电脑的人越来越多,由于使用电脑时间过长,我们的眼睛也越发容易疲劳,干燥.如何才能使电脑对人眼的伤害减小到最 小. 小编建议大家可以把窗口背景色设置成护眼色. ...
- UITableViewCell的选中时的颜色设置
转自:http://hi.baidu.com/zhu410289616/item/0de0262910886011097508c2 1.系统默认的颜色设置 //无色 cell.selectionSty ...
- python终端颜色设置
1.颜色定义说明 格式:\033[显示方式;前景色;背景色m 前景色 背景色 颜色 --------------------------------------- 30 40 黑色 31 41 ...
- 【转】iOS开发UITableViewCell的选中时的颜色设置
原文网址:http://mobile.51cto.com/hot-404900.htm 1.系统默认的颜色设置 //无色 cell.selectionStyle = UITableViewCellSe ...
- IOS开发之——颜色设置
颜色设置: 指定RGB,參数是:红.绿.黄.透明度,范围是0-1 + (UIColor *)colorWithRed:(CGFloat)red green:(CGFloat)green blue:(C ...
随机推荐
- Attempt to fetch logical page (...) in database 2 failed. It belongs to allocation unit xxxx not to xxx
今天一个同事说在一个生产库执行某个存储过程,遇到了错误: Fatal error 605 occurred at jul 29 2014 我试着执行该存储过程,结果出现下面错误,每次执行该存储过程,得 ...
- Oozie-4.0.0-cdh5.3.6搭建
到官网下载安装包 解压并cd到安装目录 解压目录下的 oozie-hadooplibs-4.0.0-cdh5.3.6.tar.gz 会自动解压成目录hadooplibs 创建文件夹 libext 将 ...
- php之验证码小程序
验证码功能(个人理解): 减轻服务器的压力(如12306的验证码功能): 防止暴力注册 个人思路:在a-z,A-Z,1-9生成n位随机的数来构成新的验证码. 关于生成验证码的几个小函数 range() ...
- Eclipse 安装 jBPM 插件
下载jbpm-installer安装包并解压,找到 jbpm-installer\build.properties搜索eclipse.home 修改 eclipse.home=./eclipse 成 ...
- 第4章 Java接收用户输入
第4章 Java接收用户输入 1.输入 使用Scanner工具类可以换取用户输入的数据Scanner类位于java.util包中,使用时需要导入此包使用步骤: 1.导入java.util.Scanne ...
- VS2010和opencv-2.4.10、GDAL
系统环境:win10 64位 本文只限于学习交流,商业用途请支持正版! 转载请注明:转载请注明http://www.cnblogs.com/mxbs/p/6206060.html 2016 ...
- [原]那些年整理的Linux常用命令,简单明了
查询相关 find 按规则查找某个文件或文件夹,包括子目录 find . -name '*.sh' -- 以.sh结尾的文件 find . -name '*channel*' -- 包含channel ...
- c#读写txt
附加到txt:StreamWriter sw =System.IO.File.AppendText(path); //绝对路径 sw.Write("写入内容"); 写入到txt: ...
- C++11笔记<一>
目录: 1.std::share_ptr智能指针: 2.std::tr1::function模板类: 3.stringstream: 4.set/vector/map: 5.static_cast&l ...
- 【jQuery】 jQuery上下飘动效果
jQuery实现图片上下飘动效果 function moveRocket() { $(".smallShip") //2000毫秒内top = top + 60: .animate ...