jquery动态改变背景颜色插件

时间:2025-03-09 22:34:26

GETHUB下载地址


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

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



使用方法:

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