471,073 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,073 software developers and data experts.

Image cache breaks

Hi all,

I am using this javascript to preload a series of low resolutio
images, that are used to in conjunction with a slider. It work
perfectly. (jvLoResPathArr is an array of urls to the images)

if(document.images) {
imagesCache = new Array()
for (i=0;i<jvLoResPathArr.length;i++) {
imagesCache[i] = new Image
imagesCache[i].src = jvExternalSharePath + jvLoResPathArr[i]
}
}

However!!!!!!

I allow the user to click on the current low resolution image, so the
can see the hi resoltion image in a child window. Now after they d
that, the images are no longer cached???????? It seems they ge
'pushed' out of the cache.

the code to open the new window is:
win = window.open("HiResWindow.cfm", "HiResWindow"," width=" + width
",height=" + height + ",left=0,top=0,toolbar=no
menubar=no,scrollbars=no, resizable=yes, location=no, directories=no
status=no")
Has anybody got any ideas?

Thanks for any help.
When the use
-
johnthoma

Jul 23 '05 #1
1 1156
Lee
johnthomas said:

Hi all,

I am using this javascript to preload a series of low resolution
images, that are used to in conjunction with a slider. It works
perfectly. (jvLoResPathArr is an array of urls to the images)

if(document.images) {
imagesCache = new Array()
for (i=0;i<jvLoResPathArr.length;i++) {
imagesCache[i] = new Image
imagesCache[i].src = jvExternalSharePath + jvLoResPathArr[i]
}
}

However!!!!!!

I allow the user to click on the current low resolution image, so they
can see the hi resoltion image in a child window. Now after they do
that, the images are no longer cached???????? It seems they get
'pushed' out of the cache.


There are a couple of possibilities, depending on how
you're displaying the low resolution images and how
you're popping up the hi res version.

If you assign the src of the low res images by specifying
the full URL again, rather than by assigning from the src
of the imagesCache[] array, then you're bypassing the
pre-loaded versions and are subject to having data pushed
out of the cache.

But it seems unlikely that your hi res versions are big
enough to clear the cache.

It would help to have a link to your page, or to see
more of the relevant code.

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Ken | last post: by
3 posts views Thread by dave | last post: by
2 posts views Thread by thehuby | last post: by
62 posts views Thread by ivan.leben | last post: by
6 posts views Thread by Mark Denardo | last post: by
1 post views Thread by Chuck Anderson | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.