jq清空动画分两种情况
1 类似这种
$(document).ready(function(){
$("#start").click(function(){
$("div").animate({
height:300,
width:300,
opacity:.4,
marginLeft:20
},1500);
});
$("#stop").click(function(){
//重点来了
$("div").stop();
});
});
2 还有这种
$(document).ready(function(){
$("#start").click(function(){ //队列动画
$("div").animate({height:300},1500)
.animate({width:300},1500)
.animate({height:100},1500)
.animate({opacity:100},1500);
});
$("#stop").click(function(){
//重点来了
$("div").stop(true,false);
});
});
本文介绍了jQuery中清空动画的两种情况,包括不同类型的动画清除方法,帮助理解如何在jQuery中停止或清除正在进行的动画效果。
505

被折叠的 条评论
为什么被折叠?



