SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2008
    Location
    cincinnati
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    css for preloading not working need js?

    This site, kettlebrewed.com (sorry, it wouldn't let me make it a link, cause I'm a newbie) is for a client that half designed the site using templates and frames and then passed it off to us to finish the hard parts.
    The intro page (index.hmtl) with the little kettle on the yellow is an all html page-no frames- that uses this css to preload the images for the following page built with frames (homepage.html). This seems to work nicely, the page loads fast, no white boxes while images appear. It's the next page (pick any) that you choose to navigate to that loads poorly. Here is the css code we used.
    <style type="text/css">
    .hiddenPic {display:none;}
    </style>

    We used the same css to preload the images for the next level of pages, but as you can see, the first page selected loads in chunks. As if it is reloading all the images again from the server instead of the cache, and the pre-load css is not helping...
    But, now if you click to any other page the images load from the cache and the pages display quickly.

    Can anyone suggest why preloading the new images for the next pages doesn't work? Why is it ignoring the same images on the cache and fetching them again from the server? but only once?
    Does this have something to do with it being built in a frames?
    Is there perhaps some js code that might work?
    thanks, anything is appreciated!

  2. #2
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    some browsers don't preload content with the display set to none.
    You can put the images in a visibility hidden div, and position it absolutely to keep it from affecting the page layout.
    javascript new Image would work, but it isn't necessary.


Tags for this Thread

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
  •