JavaScript查詢畫面大小

  • 3067
  • 0

摘要:JavaScript查詢畫面大小


function clientSize() 
    {
        if (window.innerHeight >= 0) 
        {
            alert(window.innerWidth+" x "+window.innerHeight);
        } 
        else if (document.documentElement) 
        {
            alert(document.documentElement.clientWidth+" x "+document.documentElement.clientHeight);
        } 
        else if (document.body.clientHeight >= 0) 
        {
            alert(document.body.clientWidth+" x "+document.body.clientHeight);
        } 
        else 
        {
            alert(0+" x "+0);
        }
    }

 






Y2J's Life:http://kimenyeh.blogspot.tw/