PDA

View Full Version : Making a DIV appear then disappear?



Remotive
08-26-2007, 06:03 PM
Well, I am working with DIVS at the moment, and I have looked around for a few scripts, but can't find them, this being one of them, I want it so you click a link then it appears for about 4 seconds, then dissapears. :)

I tried myself, but failed. :( Miserably...

Twey
08-26-2007, 06:16 PM
<a href="/blah" onclick="document.getElementById('mydiv').style.visibility = 'visible'; setTimeout(function() { document.getElementById('mydiv').style.visibility = 'hidden'; }, 4000);">Clicky</a>
<div id="mydiv" style="visibility: hidden;">Temporary content</div>