Hello,
I've had to strip out all the images on our 'work' section as they were making the page weigh in close to 1MB!
I've been working on this Javascript
<script language="JavaScript">
function flip(name,src) {
if (navigator.appName == "Microsoft Internet Explorer" {
document.all.wait.style.visibility="visible";
}
else {
document.layers["wait"].visibility = "visible";
}
swapImage='images/clients/'+src
if (document.images){
document.images[name].src = swapImage;
imageTimeout = setTimeout('loadTest(name)',1000);
}
}
function loadTest(name){
if (document.images){
document.images[name].onLoad=showImage();
}
}
function showImage() {
//remove this alert when fixed....
alert("loaded"
if (navigator.appName == "Microsoft Internet Explorer" {
document.all.wait.style.visibility="hidden";
}
else {
document.layers["wait"].visibility = "hidden";
}
}
</script>
I inserted a timeout to see wether that would help, as before the onload would trigger instantly. It basically should show the 'wait' layer untill the image is loaded. Any ideas on how i can overcome this problem much appreciated.
Benjer
I've had to strip out all the images on our 'work' section as they were making the page weigh in close to 1MB!
I've been working on this Javascript
<script language="JavaScript">
function flip(name,src) {
if (navigator.appName == "Microsoft Internet Explorer" {
document.all.wait.style.visibility="visible";
}
else {
document.layers["wait"].visibility = "visible";
}
swapImage='images/clients/'+src
if (document.images){
document.images[name].src = swapImage;
imageTimeout = setTimeout('loadTest(name)',1000);
}
}
function loadTest(name){
if (document.images){
document.images[name].onLoad=showImage();
}
}
function showImage() {
//remove this alert when fixed....
alert("loaded"
if (navigator.appName == "Microsoft Internet Explorer" {
document.all.wait.style.visibility="hidden";
}
else {
document.layers["wait"].visibility = "hidden";
}
}
</script>
I inserted a timeout to see wether that would help, as before the onload would trigger instantly. It basically should show the 'wait' layer untill the image is loaded. Any ideas on how i can overcome this problem much appreciated.
Benjer