In regards to preloading images. I am seeing several ways to do that and I am also reading here on this forum that it doesn't make any difference if you preload or not.
Any comments?
In regards to preloading images. I am seeing several ways to do that and I am also reading here on this forum that it doesn't make any difference if you preload or not.
Any comments?
Hmm.......................................
Why do you want to preload them?
....(o_ Penguins
.---/(o_- techno_racing
+(---//\-' in
.+(_)--(_)' The McMurdo 500
The olny reason I have ever proloaded images, for an instant rollover effect, and was concerned about what the rollover effect would like to someone on dial up.
In this case, it's most definitely a good idea to preload images.
Preloading rarely does any harm; in this case it would do a lot of good, because the images will (or at least could) load before the user causes them to be displayed.
You might also want to only set up the mouseover (if you're doing it with JS) once the images have loaded. That way, if someone does mouse over the image before the replacement has loaded, they just won't get the mouseover effect, rather than having the original image replaced with a blank "could not load image" box.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
What harms are there?
Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
Currently: enjoying the early holidays :)Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide
I probably use a weird method to preload images...
Code:.preload{ width: 1px; height: 1px; display: none;}I have that before the instance where the hover image is needed. That way, the hover image begins loading before the before image does.HTML Code:<img src="ex_hover.jpg" alt="Preload" class="preload" />
Thou com'st in such a questionable shape
Hamlet, Act 1, Scene 4
Setting the width and height is kind of pointless when you're using display: none.
A blank alt should be used here since the image provides no information (and will never be seen anyway).
You're still using XML syntax.
This is useful if you want to do CSS rollovers. However, if JS is being used preloading images like this is a waste of time and bandwidth for non-JS users, and offers less control.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Bookmarks