Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用右侧的幻灯片效果为宽度设置动画?
这是我的代码:
$(".toggle").click(function(){ $(".wrapper").animate({ width: "80%" }); });
谢谢!
你可以这样做:
$(".toggle").click(function () { $(".wrapper").animate({ width: "80%" }, { duration: 1000, specialEasing: { width: 'linear' } }); });
小提琴演示
$("#go").click(function(){ $("#block").animate({ width: "70%" }, 1500 ); });