How to get the Height of window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • soms2m
    New Member
    • Apr 2008
    • 6

    How to get the Height of window

    Hello All,

    How to get the dynamically increasing height of the window using javascript?\

    Thank you all,
  • mrhoo
    Contributor
    • Jun 2006
    • 428

    #2
    Here is one way- it adds a global winSize array with two methods.

    Calling winSize[0]() returns the window width,
    winSize[1]() returns the height.


    [CODE=javascript](function(){
    if(window.inner Width){
    winSize=[function(){ return window.innerWid th},
    function(){retu rn window.innerHei ght}]
    }
    else{
    var B= document.body;
    var D= document.docume ntElement;
    D= (D.clientWidth) ? D: B;
    winSize=[ function(){retu rn D.clientWidth},
    winHeight= function(){retu rn D.clientHeight}]
    }
    })()[/CODE]

    Comment

    Working...