Kill delay() execution using jQuery

Asked

Viewed 68 times

0

I’m wearing exactly this:

fadeIn(1000) - delay(6000) - fadeOut(1000) (8 seconds)

To display an alert for the user, I decided to put in the alert itself a button for the user to give dismiss, using the fadeOut(300) but it doesn’t work.

The fadeOut only executes after the delay() finish, have to force the stop delay() ?

  • 1

    In this case you could post an answer so the question is not open.

1 answer

0

I got it, I took a look at the DOC of Jquery, the function stop(), kills the animations execution queue, just use: stop().fadeOut(300); that works beauty!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.