var x = 0;
for(x=0; x < number_of_images; x++){
new image().src = "images/image_" + x + ".jpg";
}
am i right i only needs this to make sure the images are already in the cache of the explorer?
and then later on they are called bij an <img> object which should show the already cached image... ?
just to be sure
am i right i only needs this to make sure the images are already in the cache of the explorer?
and then later on they are called bij an <img> object which should show the already cached image... ?
If by 'later on' you mean when another script subsequently loads them into an <img> placeholder, then yes.
Where used, return should be executed unconditionally and always as the last statement in the function.
That's my signature, it's not part of the damn post!
Well, by 'later on' i mean displaying them like this:
<img src="images/image_1.jpg" alt="image_1">
<img src="images/image_2.jpg" alt="image_2">
etc...
So it will use the cached?
___________________________________
another thing thats comes to my mind:
the thing is, depending on which menu item is clicked, the images folder kan be different, but the sequence of the image names remains the same... :
Code:
var x = 0;
for(x=0; x < number_of_images; x++){
new image().src = "projects/image_" + x + ".jpg";
}
is this a problem?
will the image \images\image_1.jpg be in cache automatically be overwritten by \projects\images_1.jpg
sorry for al my questions but as you can see, i'm rather new to this
Thank you for your time!
When the only tool you have is a hammer, everything looks like a nail.
Well, by 'later on' i mean displaying them like this:
<img src="images/image_1.jpg" alt="image_1">
<img src="images/image_2.jpg" alt="image_2">
etc...
So it will use the cached?
No, pre-loading images that are to be displayed initially is pointless.
will the image \images\image_1.jpg be in cache automatically be overwritten by \projects\images_1.jpg
No.
Where used, return should be executed unconditionally and always as the last statement in the function.
That's my signature, it's not part of the damn post!
Wel, they are not displayed initially,
it's like a photo/image slide show.
with the above code, i preload the images that will be displayed when the user advances trough the slide show... of course i don't display them directly on the first page :-)
so i hope my code isnt pointless?
greetings,
When the only tool you have is a hammer, everything looks like a nail.
Bookmarks