|
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/
[Back to original message]
|