jquery.color.js 介绍
Jquery本身 不支持 变色,Jquery Color.js弥补了这缺陷并为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>
支持 的其他 属性 如下
backgroundColor,borderB ott omColor,borderLeftColor,borderRightColor,borderTopColor,color,columnRuleColor,outlineColor,text decoration Color,textEmphasisColor
GitHub: https://github.com/jquery/jquery-color
网站描述: 支持 颜色动画处理的jQuery 插件
jquery.color.js官方网站
官方网站:
如果觉得 网站内容还不错,欢迎将 网站 推荐给程序员好友。