Html image preloader

Discussion in 'HTML & Website Design' started by Nicky21, Jan 27, 2005.

  1. #1
    hello

    I have a question about preloading images in html.

    As fas as i understand: if an imge is displayed higher in the html code the browser will try to load it among the first, right?

    Now i need some images loaded first on my site, before are the other ones loaded. What code should i use? preferablily one that doesnt get me banned from se's...

    I'm using:
    <?
    //preloader
    for ($i=1; $i<=9; $i++) {
    print '<img src="img/window-1_0'.$i.'.gif" style="position: absolute; left: 0; top: 0; visibility: hidden;">';
    }
    ?>


    But apparently that doesn't work.

    Another solution would be to use css styles but that would be time consuming. Anybody knows a good trick for doing that?
     
    Nicky21, Jan 27, 2005 IP
  2. joseph29

    joseph29 Peon

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Go with Styles ... best luck overall.
     
    joseph29, Jan 27, 2005 IP
  3. SEbasic

    SEbasic Peon

    Messages:
    6,317
    Likes Received:
    318
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yup, If you design the site using CSS, you have a lot more control where elements are displayed within the code...

    I'd say that was your best bet...

    Alternativly, I started a thread not long ago abou how to delay a bit of flash from loading...

    Most of the principles in that thread could be used to delay the loading of other elements on the page too...
    http://forums.digitalpoint.com/showthread.php?t=6632
     
    SEbasic, Jan 27, 2005 IP