E
edfialk
hello, I have a web app up at http://niceguy.wustl.edu/NEISGEI/OMIComp
If you click calculate, the current settings will be used to perform
some calculations on air quality datasets and present them using
OpenLayers. These calculations take a bit to load and I would really
like a loading animation that disappeared when the image was finished
loading.
I finally found this great code from Sion Willison over at:
http://www.dzone.com/r/simon_willisons_addloadevent.html
Unfortunately, the third loading image does not disappear. It just
keeps spinning after the image is done.
There are no errors that pop up on the page, and no misnamed divs.
Basically the code is:
function addLoadEvent1(func) {
var oldonload = window.onload;
if (typeof oldonload == 'function') {
window.onload = function(){
oldonload();
func();
}
} else {
window.onload = func;
}
}
addLoadEvent1(function() {
document.getElementById("loading1").style.display="none";
});
Same code 3 times (addLoadEvent2, 3, etc.) and the first 2 work
perfectly!
Does anyone have any ideas what would stop the third from
disappearing?
Thanks for any advice at all!
-Ed
If you click calculate, the current settings will be used to perform
some calculations on air quality datasets and present them using
OpenLayers. These calculations take a bit to load and I would really
like a loading animation that disappeared when the image was finished
loading.
I finally found this great code from Sion Willison over at:
http://www.dzone.com/r/simon_willisons_addloadevent.html
Unfortunately, the third loading image does not disappear. It just
keeps spinning after the image is done.
There are no errors that pop up on the page, and no misnamed divs.
Basically the code is:
function addLoadEvent1(func) {
var oldonload = window.onload;
if (typeof oldonload == 'function') {
window.onload = function(){
oldonload();
func();
}
} else {
window.onload = func;
}
}
addLoadEvent1(function() {
document.getElementById("loading1").style.display="none";
});
Same code 3 times (addLoadEvent2, 3, etc.) and the first 2 work
perfectly!
Does anyone have any ideas what would stop the third from
disappearing?
Thanks for any advice at all!
-Ed