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 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    if (preload.complete)

    PHP Code:
    var preload = new Image();
    var 
    img = new Image(0,0);
    var 
    preload = new Image();

    if(
    preload.complete) {
    img.src preload.src;
    function 
    doSomething()                
         {
    // execute code
    }


    How to do use this an array of images and
    PHP Code:
    if(preload.complete
    Meaning can if(preload.complete) be used for an array too

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    Code:
    var preloads = [new Image(), new Image(0,0)];
    gives an array of images and no you cannot use the preloads.complete because the array object will not have a complete attribute. you have to loop through the individual elements


  •  

    Posting Permissions

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