You are here: Re: preload img « HTML « IT news, forums, messages
Re: preload img

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация