Results 1 to 2 of 2
Feb 7, 2014, 16:07 #1
- Join Date
- Sep 2005
- British Columbia, Canada
- 0 Post(s)
- 0 Thread(s)
Caching background Images on page load?
Every time I click on a navigation button (Home, About, Contact, etc.) it loads refreshes the CSS background images. Is there a good way to cache the backgrounds so that they don't have to keep loading every time?
Thanks,"To make an apple pie from scratch,
you must first create the universe.”
Feb 8, 2014, 09:37 #2
- Join Date
- Jan 2003
- Hampshire UK
- 158 Post(s)
- 3 Thread(s)
If you are talking about the first time that you hover over an element such as a nav then the best way is to use sprites so that the over state of the image is loaded along with the normal state and doesn't need to be fetched when you need the hover state. This old example uses this image for the normal and hover states.
If you have different images for each state then you have to class every item and adjust the background-position to fit each item as required.
If you are experiencing some other issue then it may be that you have set images not to be cached in your browser settings.