$(".dh_cont").eq(2).animate({
"height":"170px",
"border-color":"red"
},1000);
animate不能改变border的颜色吗?为嘛高度可以改变,border颜色不能改变呢??
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
jQuery.UI 中支持颜色的动画
https://jqueryui.com/animate/Animating colors
https://bitstorm.org/jquery/color-animation/因为animate方法的实现原理是用定时器根据步长来逐渐改变属性值,因此只支持数值型的属性改变,颜色不具有十进制的增减性,所以实现不了。要渐变的话有一些插件可以实现的。
jquery的animate没有提供颜色相关的动画,你可以试试用css3的transition。