jQuery动画stop()的用法

<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src=”https://code.jquery.com/jquery-1.10.2.js“></script>
<meta charset='utf-8'>
</head>
<body>
<button id="stop">停止动画</button>
<button id="begin">继续动画</button>
<p class="testslide" style="background-color: blue;width:100px;height:400px">

</p>
<script type="text/javascript">
$(function(){
$('#begin').click(function(){
$('.testslide').slideUp(3000).animate({height:100},2000);
});
$('#stop').click(function(){
$('.testslide').stop();
});
});
</script>
</body>
</html>

你可能感兴趣的:(jQuery动画stop()的用法)