function alertSize() {
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
window.alert( 'Width = ' + myWidth );
window.alert( 'Height = ' + myHeight );
}
http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
分享到:
相关推荐
In desktop and mobile builds, the build size reflects the size of the resulting sharedassets0.assets, sharedassets1.assets (and so on) files that are generated. Also counted are the files in the ...
After finding the vulnerability, the attacker needs to scan for hosts that are vulnerable. The target is basically to compromise a series of systems by exploiting that particular vulnerability. Any ...
The Size of It All Activation The Edit Menu OLE and the Clipboard Copying and Cutting OLE Objects Links Drag-and-drop Getting Started with Drag-and-drop Take a Drag On the Clipboard ...
PEP 486: Make the Python Launcher aware of virtual environments PEP 488: Elimination of PYO files PEP 489: Multi-phase extension module initialization Other Language Changes New Modules typing ...
- **Installation and Administration of Toad**:涵盖了Toad的安装过程与管理选项。 - **Window Privileges and Toad**:解释了窗口权限如何影响Toad的使用。 - **Toad for Oracle, Read-Only**:讨论了只读模式下...