|
Posted by Jim Higson on 10/30/85 11:41
alexjaquet@gmail.com wrote:
> 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
If the image is small (less than 500bytes) you can remove the need for a
separate image in modern browsers altogether by putting a data URL in the
CSS.
Of course, this is messy, so I add the data URLs in using PHP.
--
Jim
Navigation:
[Reply to this message]
|