|
Posted by Brian Cryer on 11/24/76 11:41
<alexjaquet@gmail.com> wrote in message
news:1141384182.613947.325780@i39g2000cwa.googlegroups.com...
> Hi,
>
> I'm trying to preload image for a better user experience but it doesn't
> work
>
> I find a simple script to load image
>
> <SCRIPT language="JavaScript">
> if (document.images)
> {
> pic1= new Image(300,60);
> pic1.src="../images/vendeur_detail_$LANG.gif\";
> }
> </SCRIPT>
>
> then I try to use it this way :
>
> <div id="test><img alt="" name="pic1"></div>
>
> but the image doesn't appear
>
> any help would be appreciate thx
To use it, you want (using your example):
<div id="test><img alt="" src="../images/vendeur_detail_$LANG.gif"></div>
remember, its the browser that is doing the caching. All your preloading is
doing is trying to ensure that the image is already present in the cache.
Hence why you refer to the image by its source url.
Hope this helps.
--
Brian Cryer
www.cryer.co.uk/brian
Navigation:
[Reply to this message]
|