I have a multi-image rollover script, the only issue is that it loads images one at a time and for the first second or so the complete image looks dissociated.
is there a way to load all the images at once, or to "not rollover until all images loaded"
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)
yeah, if you use the complete property of images, you could write a script which checks that all have completed before executing the rollover. basically, increment a value according to the number of complete images, and when it reaches the length of your image array, then you're ready for take-off.
__________________
"Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark
you can see that there is a delay with the onmouseover on the enter sign, even though i use a really cool script that willy and i developped called a postload script, which allows the page to load and then once it's loaded, preceeds to load any images specified into an array.
here's the code
Code:
</script>
<script type="text/javascript">
//<![CDATA[
function postLoad(){
if(!window.name.match(/preLoad.complete/gi)){
var images = new Array('EnglishOn.gif',
'EnterOn.gif',
'EntrerOn.gif',
'FrenchOn.gif');
var loader = new Array();
for(var i=0; i<images.length; i++){
loader[i] = new Image();
loader[i].src = images[i];
}
window.name = 'preLoad.complete';
}
}
//]]>
</script>
...
<body onload="postLoad()">
but there still seems to be a delay... which you can see if you go to the url.
it is a 7 image rollover, but with postloading that should be compensated for...
any thoughts?
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)
The advantages of Postloading is that it allows the page to quickly load without waiting for those images to load first and allows these images to load in the background after the page has been displayed.... This technique is particularly useful for image slideshows or when you wish to preload your next pages images.... But, there will be a slight delay if used with rollovers and someone jumps to one of the links immediatedly on page load and prior to these postloaded images having a chance to load....
I'm sure I mentioned this when we were discussing Postloading versus Preloading but your solution is to Preload..... Either remove the function wrapper or call the function on window.onload....
its odd though willy, i have left the page for a full minute without moving my mouse, but when i go over the rollover there's still what seems to be a loading delay.
try it and tell me what you find
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)
But since there is really is not much content on that page and since the images are rather small... It would not hurt to preload rather than postload....
The EntrerOn.gif is a rollover image, and is only loaded when the user does an onMouseOver
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)
The EntrerOn.gif is a rollover image, and is only loaded when the user does an onMouseOver
The logic is to preload all images, no matter how small the file size. The images will be loaded into the cache. Waiting for rollover images to download on mouseover is not a good practice.
In fact, even if the images have already been loaded, it is better to swap layer visibility, instead of the actual images.
-james
__________________
"God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "
i think i'm gonna take my pretty pink skirt and go home.
wow
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)