[thelist] Re: preloading images [was: Apparently I Owe One]

matthew garrett matthew.garrett at snet.net
Wed Feb 7 09:27:31 CST 2001


I had already specified the sizes.
It is a matter of the browser being in the process of loading the image,
then being interupted by a new request, and then you're stuck with a
partially loaded image in the browser cache. So when the browser looks for
the image in the next page, it finds the file in it's cache and puts it in
the spot - whether it is finished loading, the browser knows not.

Use it, just make sure to test it by clicking through too fast on all
browsers (or on a really slow connection).

Matt

> <tip type="solution">
> change "new Image()" to "new Image(width, height)" to avoid the partial
> image problem.
> </tip>
> 

>> <warning>
>> I've tried similar schemes, and various browsers (IE on Mac for one, i
>> think) will end up with partial images if the user clicks through before the
>> graphic finishes loading. Even if they re-load the page, it's still partial.
>> 
>> Not pretty. i gave up without finding any adequate solution.
>> </warning>





More information about the thelist mailing list