Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Dec 2005
    Thanked 0 Times in 0 Posts

    is preloading images possible ??

    Hello friends !!
    My Question:
    suppose i have to show the photo gallery,
    and suppose it has 5 image links
    Refer the following:
    | Image preview of links 1 -5 goes here here..
    Links 1 | 2 | 3 | 4 | 5
    when clicked on link1 preview of 1 show appear and similarly up to 5.
    What i want to do?
    I want to display the images without loading when clicked on the link
    and i suppose it can be done using javascript, problem is how to preload the
    images so that when the link is clicked image should instatly appear in the preview section.
    Is there any idea to perform this ?
    I would be very greatful for the soultions.
    Thanks in advance to all of YOU !!

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Sydney, Australia
    Thanked 666 Times in 655 Posts
    The only way to preload images without using Javascript is to include the images in the previous page being displayed. You place them at the very bottom of the page set their width and height to 1 pixel and set visibility:hidden

    To do it with Javascript means that the page loads more slowly to start with because all of the images are downloaded at once when the page first loads rather than waiting until they are needed.
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


    Posting Permissions

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