jquery stop() メソッド


  翻訳結果:

stop

UK[stɒp] US[stɑ:p]

vi. 停止; 中断; 停止; (させる) 作業を停止する

vt. 停止; ブロック; ブロック; 支払い停止

n.stop; (オルガン) 音停止; 停止; (オルガン) 音パイプ

jquery stop() メソッド構文

関数: stop() メソッドは、現在実行中のアニメーションを停止します。

構文: $(selector).stop(stopAll,goToEnd

パラメータ:

パラメータDescription
stopAll オプション。選択した要素のキューにあるすべてのアニメーションを停止するかどうかを指定します。
#goToEnd オプション。現在のアニメーションの完了を許可するかどうかを指定します。このパラメータは、stopAll パラメータが設定されている場合にのみ使用できます。

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>
インスタンスの実行 »

[インスタンスの実行] ボタンをクリックしてオンライン インスタンスを表示します

人気のおすすめ