order of events in a browser, how javascript controls it?

Last post 06-28-2009 8:52 PM by gmmo1971. 1 replies.

Sort Posts:

  • order of events in a browser, how javascript controls it?

    06-28-2009, 3:07 PM
    • Member
      14 point Member
    • gmmo1971
    • Member since 06-01-2008, 6:10 PM
    • Posts 67

     Hi, I am trying to write a simple ajax control that is a slide show.

     

    However, there is a detail I'd like to accomplish but not sure if it is possible. Basically I want the browser to load a new image on the background while I transition from one picture to another.

     

    But  the fundamental feature relies on my ability to control the events on the browser. In other words, if I have something like this:

     

    bigImage1 = new Image();
    bigImage1.src = "images/newimage.jpg"
    

     

    do you know precisely when the browser loads the new image when the client script changes the source? It doesn't look like it does immediately neither it seems consistent among browers.

     

    if anyone know someone who worked on IE or Safari, I'd love to ask them this question directly.

    thx!


     

     

     

  • Re: order of events in a browser, how javascript controls it?

    06-28-2009, 8:52 PM
    Answer
    • Member
      14 point Member
    • gmmo1971
    • Member since 06-01-2008, 6:10 PM
    • Posts 67

    I found this flag:

     

    image.complete

     

    that works in nearly every browser except firefox. This is exactly what I need to determine the order of when images are loaded.

     

    Anyone knows the equivalent for Firefox?

     

    thx!

Page 1 of 1 (2 items)