/ Published in: JavaScript

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.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$(document).ready(function(){ setTimeout(function(){ $("div.mydiv").fadeOut("slow", function () { $("div.mydiv").remove(); }); }, 2000); });
URL: http://papermashup.com/jquery-fading-a-div-after-a-certain-time/
Comments
