$(".dh_cont").eq(2).animate({
"height":"170px",
"border-color":"red"
},1000);
animate不能改变border的颜色吗?为嘛高度可以改变,border颜色不能改变呢??$(".dh_cont").eq(2).animate({
"height":"170px",
"border-color":"red"
},1000);
animate不能改变border的颜色吗?为嘛高度可以改变,border颜色不能改变呢??因为animate方法的实现原理是用定时器根据步长来逐渐改变属性值,因此只支持数值型的属性改变,颜色不具有十进制的增减性,所以实现不了。要渐变的话有一些插件可以实现的。
11 回答1.2k 阅读
1 回答862 阅读✓ 已解决
1 回答1.1k 阅读
2 回答781 阅读
2 回答627 阅读
2 回答607 阅读
1 回答687 阅读
jQuery.UI 中支持颜色的动画
https://jqueryui.com/animate/Animating colors
https://bitstorm.org/jquery/color-animation/