www.webdeveloper.com
Results 1 to 2 of 2

Thread: pre loaded images

  1. #1
    Join Date
    Dec 2002
    Posts
    55

    pre loaded images

    I'm pretty sure this is done with jave script, but maybe not, so thats why its here in "general". I have rollover script...but the pictures take about 2 secs to load on every mouseout/mouseon . How can i preload them, so that they rollover smoothly after page is done loading?
    Thanks

  2. #2
    Join Date
    Nov 2002
    Posts
    984
    Preloading can be done in many ways, with Javascript, CSS and even plain HTML.

    The simplest is probably by using CSS, which is just down to placing the image towards the end of your page and then hiding it.
    There are many ways to hide it, but one that works quite well is to simply place the image outside the screen.

    Eg

    <body>
    your page
    <img class="preload" src="" alt="">
    <img class="preload" src="" alt="">
    <img class="preload" src="" alt="">
    </body>

    CSS:
    .preload {position:absolute; top:0; left:-1000px}
    // Stefan Huszics

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles