You are here: Re: Css and image load times « HTML « IT news, forums, messages
Re: Css and image load times

Posted by Jukka K. Korpela on 07/09/07 13:56

Scripsit Gin:

> How to load first an image that I'm positioning using css ?

The loading order can be affected in JavaScript, on browsers that have
scripting enabled. For example, put the following right after the <html> tag
(so that the code will be executed as early as possible):

<script type="text/javascript">
if(document.images) {
img1 = new Image();
img1.src = "foobar.gif"; }
</script>

(It's old-style JavaScript, but should work well enough.)

> The image is loaded after all the images on my html template.

The loading order depends on many things, including their order of
appearance in the HTML source.

> I'm using css for simplicity, because with it I can position this
> image on the top left side of my page, without complex
> html table architectures.

That's fine. If you use the same image, with exactly the same URL (after
relative URLs have been resolved to absolute URLs), then browsers will most
probably cache the image so that it is practice readily available after a
user has visited one of your pages. (Unless you do something to prevent
caching; but you probably don't.)

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 

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

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