How to hide message after few seconds in jquery.


 

Many of you want to hide element after page loading in website.

Many of you might be wondering that Is it possible to automatically hide an element in a web page 5 seconds after the form loads using jQuery?

and the answer is : Yes, its possible to hide element after few seconds.

For hiding any message, div, element, container then following script will be helping you.

$(".successMessage").delay(5000).fadeOut('slow');
OR 
$(".successMessage").delay(5000).hide(1000);

Note :
Here 5000 stands for 5000 milliseconds that means your message, div or element will hide after 5 seconds.
Here 1000 stands for 1000 milliseconds ( 1 seconds ) that means your message, div or element will take 1 second for hide

I hope it will work for you also as it worked for me:)

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s