【发布时间】:2013-06-11 21:23:37
【问题描述】:
如何使用向右滑动效果为宽度设置动画?
这是我的代码:
$(".toggle").click(function(){
$(".wrapper").animate({ width: "80%" });
});
谢谢!
【问题讨论】:
标签: javascript jquery jquery-animate width slide
如何使用向右滑动效果为宽度设置动画?
这是我的代码:
$(".toggle").click(function(){
$(".wrapper").animate({ width: "80%" });
});
谢谢!
【问题讨论】:
标签: javascript jquery jquery-animate width slide
你可以这样做:
$(".toggle").click(function () {
$(".wrapper").animate({
width: "80%"
}, {
duration: 1000,
specialEasing: {
width: 'linear'
}
});
});
【讨论】:
toggle 元素是按钮还是锚点?如果一个锚你需要使用event.preventDefault()..
$("#go").click(function(){
$("#block").animate({
width: "70%"
}, 1500 );
});
【讨论】: