jquery get the current screen width and height

<Script type = "text / JavaScript">    

$ (Document) .ready ( function ()    

{    

Alert ($ (window) .height ()); // browser window currently visible area of height    

alert ($ (document). height ()); // browser window is the current height of the document    

Alert ($ (document.body) .height ()); // browser window is the current height of the document body of    

Alert ($ (document.body) .outerHeight ( to true )); // browser this document the total height of the window margin padding body comprises a border    

Alert ($ (window) .width ()); // browser window viewing area width of the current    

alert ($ (document) .width ( ) ); // window width of the document object browser is currently    

Alert ($ (document.body) .width ()); // browser window height of the current document's body   

Alert ($ (the document.body) .outerWidth ( to true )); // browser is currently the total width of the document window margin padding body comprises a border    

}    

)   

 </ Script>   
 
View Code

 

Guess you like

Origin www.cnblogs.com/zengxh/p/12390606.html