微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

jquery.color.js

编程之家收集整理的这个编程导航主要介绍了jquery.color.js编程之家,现在分享给大家,也给大家做个参考。

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,borderBottomColor,borderLeftColor,borderRightColor,borderTopColor,color,columnRuleColor,outlineColor,textdecorationColor,textEmphasisColor

GitHub:https://github.com/jquery/jquery-color

网站描述:支持颜色动画处理的jQuery插件

jquery.color.js

官方网站:

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。