+ Reply to Thread
Results 1 to 4 of 4

Thread: Image load order

  1. #1
    learning_brain is offline x10 Sophmore learning_brain is an unknown quantity at this point
    Join Date
    Apr 2010
    Location
    UK, Midlands
    Posts
    170

    Image load order

    My Image Search Engine is now working very nicely and provides lots of high quality images....

    Thats the problem.....

    Each image was taking ages to load, so I created a dynamic thumbnail navigator with a large preview (original image) on hover (put in a span). This works pretty well, but the thumbs do not necessarily load first, and if you look at it, some of the large images in the background are already loading and taking a heavy toll before all thumbs have shown.

    After LOTS of googlereads I am coming to the conclusion that the JS onload is the only way to give any control, but does anyone else have any other ideas. (javascript not being a preferred solution in a pretty much javascript-free site).

    My other solution is to have the "large" preview as a GD created image as well, but this will seriously eat into my space.

  2. #2
    sikuneh is offline x10Hosting Member sikuneh is an unknown quantity at this point
    Join Date
    Dec 2008
    Posts
    43

    Re: Image load order

    You could go with the jQuery lightbox plugin. It lets you set up as many thumbnails as you want and it creates a new image on a larger scale of the clicked thumbnail. That is a good solution.

    jQuery lightbox: Here

  3. #3
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: Image load order

    I think the only way to do this would be through Javascript onload. Have it setup so that PHP populates a javascript array containing the URLs of every big image and when the onload triggers create the image items dynamically that'll then start the download of the bigger items.

  4. #4
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Image load order

    You could try restructuring your document so the thumbnails come first in the source, or try placing <img> elements referring to the images you want to load first in a hidden element that's the first child of <body>.

    HTML Code:
    <body>
      <div style="visibility:hidden"><img src="…" />...</div>
      ...
    There's no standard that specifies the order that images (or any replaced element) are loaded in, so the above may not work the same (or at all) on all browsers.
    Last edited by misson; 07-08-2010 at 05:59 PM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. Image on Test Page Won't Load
    By Sonic2nd in forum Free Hosting
    Replies: 5
    Last Post: 12-24-2008, 05:29 AM
  2. ORDER BY challenge..
    By freecrm in forum Programming Help
    Replies: 16
    Last Post: 10-08-2008, 06:39 AM
  3. Image Won't Load - Help Please
    By masterjake in forum Programming Help
    Replies: 2
    Last Post: 06-27-2008, 11:32 AM
  4. Anyone pre-order GTA IV?
    By Clinton in forum Gamer's Lounge
    Replies: 27
    Last Post: 05-02-2008, 08:01 PM
  5. Load a Image in Flash CS3:
    By satheesh in forum Tutorials
    Replies: 3
    Last Post: 02-26-2008, 08:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers