I searched for an old solution and found it. I could have sworn that
this gave my the viewport width and height just a moment ago. But it
started working again....

var w = 0;
        var h = 0;

        if (typeof(window.innerWidth) == 'number') {
            w = window.innerWidth;
            h = window.innerHeight;
        } else if (document.documentElement &&
            (document.documentElement.clientWidth ||
document.documentElement.clientHeight)) {
            //IE 6+ in 'standards compliant mode'
            w = document.documentElement.clientWidth;
            h = document.documentElement.clientHeight;
        } else if (document.body && (document.body.clientWidth ||
                                     document.body.clientHeight)) {
            //IE 4 compatible
            w = document.body.clientWidth;
            h = document.body.clientHeight;

        return {width: w, height: h};

On Nov 29, 8:44 pm, JoJo <tokyot...@gmail.com> wrote:
> How do you get the true height of the body element? I have a very long
> page and calling getDimensions() only returns the viewable area's
> height.
> Thanks.


You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to