[Javascript] Monitor an offsetHeight value

Stephan Wehner stephanwehner at gmail.com
Thu Jan 11 13:30:51 CST 2007


On 1/11/07, Guillaume <javascript at webdesignofficina.com> wrote:
> 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);

The following code seems to be executed only once,
should it be included in the checkOptK method?

>
>         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
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>


-- 
Stephan Wehner
> http://stephan.sugarmotor.org
> http://stephansmap.org
> http://www.trafficlife.com
> http://www.buckmaster.ca



More information about the Javascript mailing list