Return to Snippet

Revision: 59188
at August 23, 2012 01:22 by dnnsldr


Initial Code
$(document).ready(function(){
   setTimeout(function(){
  $("div.mydiv").fadeOut("slow", function () {
  $("div.mydiv").remove();
      });
 
}, 2000);
 });

Initial URL
http://papermashup.com/jquery-fading-a-div-after-a-certain-time/

Initial Description
Here’s a handy bit of code that I use quite regularly, its particularly useful if your getting a response message from a form to notify the user that there data was sent, or comunicate an error and you want to fade the message out after a set time.

Initial Title
Fading out a div after set time with jQuery

Initial Tags
jquery

Initial Language
JavaScript