I want to make my animated (loading page) gif called 'load' visible while loading my image(s) as a background file in a table cell called 'mainSpace'. I started with this code:
CODE
document.getElementById('load').style.visibility = 'visible';
mainSpace.background="/clientimages/24231/home/images/ChurchSmallBG.jpg";
mainSpace.height=345;
document.getElementById('load').style.visibility = 'hidden';
The gif never shows up, and I tried leaving out the last line just to make sure the code was right, and sure enough it was.
I thought maybe the code that sets the background actually does not wait for the image to load, and that I needed to actually preload the image. So I tried this:
CODE
document.getElementById('load').style.visibility = 'visible';
imageAbout = new Image();
imageAbout.src = "/clientimages/24231/home/images/ChurchSmallBG.jpg";
mainSpace.background="/clientimages/24231/home/images/ChurchSmallBG.jpg";
mainSpace.height=345;
document.getElementById('load').style.visibility = 'hidden';
I still wasn't getting even a flicker on the gif, so I'm not sure what to do....
The gif is at the bottom of a left column cell. The loading image in the middle cell of the same table.
This isn't a huge deal except I am relying on a lot of background images of a sometimes fair size, and I have had enough of a lag in some of the loads that the animated loading-gif would be useful.
(I've also tried to set the background first as a simple image that says "loading..." and then set it to what I want, but this is not working either.)
Thanks,
David
website:
http://fbcmonahans.com/templates/System/de...&PID=571227This post has been edited by dgallaher: 6 May, 2008 - 01:42 PM