In many cases, Jquery keeps displaying and hiding html elements, especially when the mouse goes. Cause to hide and display back and forth
Copy codeThe Code is as follows:
<Script type = "text/javascript">
$ (Document). ready (function (){
$ (". Flip"). click (function () {// ********* the problem is located here, where the animation is not determined
$ (". Panel"). slideToggle ("slow ");
});
});
</Script>
<Style type = "text/css">
The correct statement is as follows:
Copy codeThe Code is as follows:
<Script type = "text/javascript">
$ (Document). ready (function (){
$ (". Flip"). click (function (){
If (! $ (". Panel"). is (": animated") {// The problem is located here, where you can determine whether the animation is in progress.
$ (". Panel"). slideToggle ("slow ");
}
});
});
</Script>
Or stop the animation queue before sliding.
Copy codeThe Code is as follows:
<Script type = "text/javascript">
$ (Document). ready (function (){
$ (". Flip"). click (function (){
$ (This). stop (). slideToggle ("slow"); // The stop () function stops the animation queue.
});
});
</Script>