stop
英 [st?p]? ?美 [stɑ:p]??
vi.停止;中斷;逗留;(使)停止工作
vt.塞住;堵塞;阻撓;止付
n.停止;(管風(fēng)琴的)音栓;停車站;(管風(fēng)琴的)音管
jquery stop()方法 語法
作用:stop() 方法停止當(dāng)前正在運行的動畫。
語法:$(selector).stop(stopAll,goToEnd
參數(shù):
參數(shù) | 描述 |
stopAll? ?? | 可選。規(guī)定是否停止被選元素的所有加入隊列的動畫。 |
goToEnd? ?? | 可選。規(guī)定是否允許完成當(dāng)前的動畫。該參數(shù)只能在設(shè)置了 stopAll 參數(shù)時使用。 |
jquery stop()方法 示例
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#start").click(function(){ $("#box").animate({height:300},2000); $("#box").animate({height:100},2000); }); $("#stop").click(function(){ $("#box").stop(); }); }); </script> </head> <body> <p><button id="start">Start Animation</button><button id="stop">Stop Animation</button></p> <div id="box" style="background:#98bf21;height:100px;width:100px;position:relative"> </div> </body> </html>
點擊 "運行實例" 按鈕查看在線實例