...

View Full Version : Using window.status



allyson
11-12-2006, 12:20 AM
Hi

The following is a preload code that I'm developing but need some assistance. I have 2 questions

1) When the images are being downloaded, the Window.status="Downloading.....". Is there a way of testing the Window.status and if it has the word "Downloading" then move on. The only problem with this is if the mouse is still on the next or previous buttons and window.status changes.

2) is there a way of measuring the bytes in the graphic being downloaded, so that when the whole graphic has loaded into preloadit[] then move on. I hope this makes sense

var preloadit=new Array()
for (i=0;i<numberslide.length;i++){
while (preloadit[i]="") {
preloadit[i]=new Image(i)
preloadit[i].src=numberslide[i][0]


}
}

bye for now
Allyson

david_kw
11-12-2006, 01:16 AM
The only way I know to find out whether or not an image has been loaded is by setting the Image.onload to call a function when it is fully loaded. I don't know of any way to get partial status.

Maybe someone else does.

david_kw

allyson
11-13-2006, 03:33 AM
:confused: Hi
I am trying to test for a full load of the images. This is the code that I've developed, but "preloadit[i].onload....." does not seem to work, as isLoaded is always false. When i is 4 or 5, i had hoped that the alert window would pop up (the alert is just for testing purposes at the moment)
Can anyone suggest why this isn't working? Please help.


loader=""
var preloadit=new Array()
isLoaded=false;
for (i=0;i<4;i++){

while (preloadit[i]=="") {
loader="Please wait..........."
preloadit[i]=new Image(i)
preloadit[i].src=numberslide[i][0]
preloadit[i].onload=new Function("numberslide["+i+"][0].isLoaded=true;")
if (isLoaded=true) {
loader="Images are ready to view"
alert("Images are fully loaded")
}
}
}

bye for now
Allyson



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum