SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Lord of the Underworld
    Join Date
    May 2000
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do you preload images, that is, loading images without them showing on say a doorway or entry pag???

    Adam

  2. #2
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The simplest way would be to load the images by creating JavaScript Image objects referring to those files you want preloaded. Just put this at the bottom of your page (because you don't want to slow down loading the current page with the preloads):

    <SCRIPT LANGUAGE=JavaScript>
    <!--

    var image1 = new Image();
    image1.src = "firstimage.jpg";

    var image2 = new Image();
    image2.src = "secondimage.jpg";

    var image3 = new Image();
    image3.src = "thirdimage.jpg";

    ...

    //-->
    </SCRIPT>

    This will tell JavaScript to load each of the named images, even though they are never actually displayed.



    ------------------
    -Kevin Yank.
    http://www.SitePoint.com/
    Helping Small Business Grow Online!

  3. #3
    Lord of the Underworld
    Join Date
    May 2000
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks Kev

  4. #4
    SitePoint Enthusiast
    Join Date
    May 2000
    Location
    Ft. Worth, TX, USA
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have also heard of stashing it in an out-of-the-way location on the page and specifying it as a 1x1 image, thus adding a (hopefully) barely visible dot in a hidden corner. Of course, this adds to page download time, as the image loads (time-wise)as though it were normal size.

    ------------------
    Pat Burroughs
    The Wheels-Off Website


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
  •