Css and image load times
am 09.07.2007 12:48:04 von gin
How to load first an image that I'm positioning using css ?
The image is loaded after all the images on my html template.
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.
Thank you
Re: Css and image load times
am 09.07.2007 15:56:08 von jkorpela
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 tag
(so that the code will be executed as early as possible):
(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/
Re: Css and image load times
am 09.07.2007 18:00:53 von Neredbojias
Well bust mah britches and call me cheeky, on Mon, 09 Jul 2007 13:56:08
GMT Jukka K. Korpela scribed:
> 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
> tag (so that the code will be executed as early as possible):
>
>
Probably should be: var img1 = new Image();
--
Neredbojias the human
Re: Css and image load times
am 11.07.2007 10:40:57 von gin
Thank you, probably you are right, the image now is at the bottom of the
page, moving it on top can solve something
Bye
"Jukka K. Korpela" ha scritto nel messaggio
news:x5rki.189057$9E1.184846@reader1.news.saunalahti.fi...
> 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
tag
> (so that the code will be executed as early as possible):
>
>
>
> (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/
>