jQuery的animate()方法做一个颜色的渐变

您所在的位置:网站首页 animate怎么填充背景 jQuery的animate()方法做一个颜色的渐变

jQuery的animate()方法做一个颜色的渐变

2024-07-04 22:30| 来源: 网络整理| 查看: 265

需求:在1秒内,由一个颜色变到另一个颜色,不是1秒后再变色。

背景渐变 div { width: 200px; height: 200px; background-color: red; color: white; font-size: 50px; font-weight: 500; } p { width: 20px; height: 20px; background-color: deepskyblue; }

123 $(function () { $("p").click(() => { $("div").animate({ width: 100, height: 100, backgroundColor: "blue", },1000); }) });

 



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3