我想将输入框的背景从白色更改为另一种颜色,然后以缓慢淡入的方式再次返回白色.我试过动画它根本不起作用.没有错误.
<script type="text/javascript" src="/jsp/ui/jquery-ui/js/jquery-1.8.3.min.js"></script>
...
$(document.getElementById(id)).animate({ backgroundColor: "#4E1402" }, 500);
Run Code Online (Sandbox Code Playgroud)
更新
这很好用
$(document.getElementById(id)).animate({ width: "400px" }, 500);
Run Code Online (Sandbox Code Playgroud)
jQuery无法为颜色设置动画.请改用此插件.
http://www.bitstorm.org/jquery/color-animation/
(仅增加4kb)
或者jquery UI动画:
http://jqueryui.com/animate/ (如下面的@Adam所述)
| 归档时间: |
|
| 查看次数: |
6383 次 |
| 最近记录: |