Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    Auckland, New Zealand
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using window.status

    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

  • #2
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #3
    New Coder
    Join Date
    Jun 2002
    Location
    Auckland, New Zealand
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    preloadit[i].onload

    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •