Results 1 to 2 of 2

Thread: Making a DIV appear then disappear?

  1. #1
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Making a DIV appear then disappear?

    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...

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    <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>
    Last edited by Twey; 08-26-2007 at 08:53 PM. Reason: Forgot to give an ID to the <div>!
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •