Image cache breaks

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • johnthomas

    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.ima ges) {
    imagesCache = new Array()
    for (i=0;i<jvLoResP athArr.length;i ++) {
    imagesCache[i] = new Image
    imagesCache[i].src = jvExternalShare Path + 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("Hi ResWindow.cfm", "HiResWindo w"," width=" + width
    ",height=" + height + ",left=0,top=0, toolbar=no
    menubar=no,scro llbars=no, resizable=yes, location=no, directories=no
    status=no")


    Has anybody got any ideas?

    Thanks for any help.


    When the use
    -
    johnthoma

  • Lee

    #2
    Re: Image cache breaks

    johnthomas said:[color=blue]
    >
    >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.im ages) {
    >imagesCache = new Array()
    > for (i=0;i<jvLoResP athArr.length;i ++) {
    > imagesCache[i] = new Image
    > imagesCache[i].src = jvExternalShare Path + 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.[/color]

    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.

    Comment

    Working...