I wonder if it's somehow possible to use the stop()
function (I normally use on animate()
) with hide()
or show()
.
if I quickly hover repeatedly over a div
which uses show()
to display some subdivs the show-animation repeats over and over again. The stop()
function would stop that behaviour.
However I've no clue how I can use the stop()
function with hide()
or show()
.
Is that even possible?
Thank you
Regards Matt
You have to set a duration for your show / hide effect:
.hide('slow')
After that you are able to use .stop()
and .stop(true,true)
stop( [ clearQueue ], [ jumpToEnd ] )
clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
Another approach would be to add an delay like
.delay(500).hide(1);
http://api.jquery.com/delay/
.delay( duration, [ queueName ] ) duration An integer indicating the number of milliseconds to delay execution of the next item in the queue.
queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With