jQuery ?? ?????
stop() ???
jQuery stop() ???? ??????? ??? ???? ?? ???? ? ?????.
stop() ???? ????, ??? ? ??? ?? ?????? ??? ?? jQuery ?? ??? ?? ?????.
??:
$(selector).stop(stopAll,goToEnd);
???? stopAll ????? ????? ???? ??? ??? ??? ?????. ???? false?? ?? ?????? ???? ???? ?? ?????? ?? ????? ?????.
???? goToEnd ????? ?? ?????? ?? ???? ??? ?????. ???? ?????.
??? ????? stop()? ??? ??? ??? ?? ?????? ????.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("#flip").click(function(){ $("#panel").slideDown(2000); }); $("#stop").click(function(){ $("#panel").stop(); }); }); </script> <style type="text/css"> #panel,#flip { padding:5px; text-align:center; background-color:#e5eecc; border:solid 1px #c3c3c3; } #panel { padding:50px; display:none; } </style> </head> <body> <button id="stop">停止滑動</button> <div id="flip">點我向下滑動面板</div> <div id="panel">Hello world!</div> </body> </html>