[Javascript] Monitor an offsetHeight value

Guillaume javascript at webdesignofficina.com
Thu Jan 11 13:12:57 CST 2007


Stephan,

Thank you for your reply. See my comments below:
>
> Are you calling checkOptJ()

Yes in the onload
>
> You could post the whole code.

The code is just the one I've already posted, there it is again:

     function checkOptJ(){ // Fired in the onload
     var opts1 = document.getElementById("options");

     moveBy1 = opts1.offsetHeight;// Initial value

 

     function checkOptK(){

     opts44 = document.getElementById("options");

     moveBy22 = opts44.offsetHeight;// Value to be checked: same as 
above but with a listener to see if it's changing
        }

     setTimeout("checkOptK();", 2000);

        if ( moveBy1 !== moveBy22) { // Compare these two values if they 
are different, if moveBy22 has grown or shrink do this below

             alert( "things have moved" );   
           }

        }

Hope this makes sense.
Regards.

Guillaume



More information about the Javascript mailing list