码迷,mamicode.com
首页 > Web开发 > 详细

jquery动态改变背景颜色插件

时间:2014-08-10 21:13:30      阅读:335      评论:0      收藏:0      [点我收藏+]

标签:des   style   http   color   使用   io   art   ar   

GETHUB下载地址


背景颜色用animate方法时时无法改变颜色的

所以要使用插件进行补充。



用法:

<!DOCTYPE html>
<html>
<head>
<style>
div {
    background-color: #bada55;
    width: 100px;
    border: 1px solid green;
}
</style>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="jquery.color.min.js"></script>
</head>
<body>
<button id="go">Simple</button>
<button id="sat">Desaturate</button>
<div id="block">Hello!</div>
<script>
jQuery("#go").click(function(){
    jQuery("#block").animate({
            backgroundColor: "#abcdef"
    }, 1500 );
});
jQuery("#sat").click(function(){
    jQuery("#block").animate({
            backgroundColor: jQuery.Color({ saturation: 0 })
    }, 1500 );
});
</script>
</body>
</html>





jquery动态改变背景颜色插件,布布扣,bubuko.com

jquery动态改变背景颜色插件

标签:des   style   http   color   使用   io   art   ar   

原文地址:http://www.cnblogs.com/mengfanrong/p/3903212.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!