Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use delay() with show() and hide() in Jquery

How can I use delay() with show() and hide() in Jquery ?

like image 326
faressoft Avatar asked Dec 22 '10 11:12

faressoft


People also ask

What is the use of delay () method in jQuery?

jQuery delay() Method The delay() method sets a timer to delay the execution of the next item in the queue.

How do I toggle between show and hide in jQuery?

The toggle() method toggles between hide() and show() for the selected elements. This method checks the selected elements for visibility. show() is run if an element is hidden. hide() is run if an element is visible - This creates a toggle effect.

What does show () do in jQuery?

The show() Method in jQuery is used to display the hidden and selected elements. Note: This method display the hidden elements which are using CSS display: none property. The elements are not visible whose visibility is hidden.

What does hide () do in jQuery?

The hide() method hides the selected elements. Tip: This is similar to the CSS property display:none. Note: Hidden elements will not be displayed at all (no longer affects the layout of the page). Tip: To show hidden elements, look at the show() method.


1 Answers

Pass a duration to show() and hide():

When a duration is provided, .show() becomes an animation method.

E.g. element.delay(1000).show(0)

DEMO

like image 97
Felix Kling Avatar answered Sep 22 '22 11:09

Felix Kling