loading gif inside div
- Started
- Last post
- 9 Responses
- airey0
so you want a preloader to run until the image loads yeah?
- epigraph0
ok so i feel a little stupid...but i was under the impression you needed to do this with js
does the css method work well?
- airey0
no idea, i've never done it but if you find a good solution let the thread know so i can steal it!
- epigraph0
ok, I sort of understand this, tell me if I've got it right. If I have an animated loading gif and i make it the background image of a div, It will display, until the huge image i have placed in the div has loaded?
- welded0
Set the gif it as a background image and when the content image loads it'll cover it up. That's probably the easiest, no fuss no muss way.
- jamble0
I sometimes find an animated gif running in the background slows a site right down over time. Might be better looking for a js based solution to this one.
- MrT0
A static one makes sense.
Here's a big file while you wait for a big file.
Errrr.
- acescence0
something like this ought to do it..
intvl = setInterval ( function() {
if ( document.images[name].complete == true ) {
alert ( "image has loaded" );
}
}, 250 );name is the name of the image you're checking.