Results 1 to 2 of 2

Thread: Need help with Image Disappear Script

  1. #1
    Join Date
    Mar 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need help with Image Disappear Script

    I would SOOO APPRECIATE someone looking at this short script which makes an image disappear after a set amount of seconds, and then advise me as to how it may be modified to FADE away, instead of just snapping into disappearance. If you just open the script into an html doc, you should see the script in action; the image in the script rests in my server directory. Thanks.

    <script type="text/javascript">window.setTimeout("document.getElementById('something').style.display='none';", 3000); </script>
    <img id="something" src="http://bestartperiod.com/fademe02.jpg" width="400" height="300" border="0" alt="" />

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Try jQuery's fadeOut function.

    Like:
    Code:
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript">
    $(function(){
        var $something = $("#something");
        $something
        .animate({"color": $something.css("color")}, 100)
        .fadeOut("slow");
    });
    </script>
    The animate function I'm using as a delay function.

    (the above code should work)
    Last edited by Nile; 03-10-2009 at 11:00 PM.
    Jeremy | jfein.net

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
  •