mohanndckap / ie6-upgrade-warning

Automatically exported from code.google.com/p/ie6-upgrade-warning
0 stars 0 forks source link

div id="_d" width and height is bad #26

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  width and height is bad

/*        change code example    */

function getBrowserWidth ( ) {  
    if ( window.innerWidth ) { return window.innerWidth; }  
    else if ( document.documentElement &&
document.documentElement.clientWidth != 0 ) { return
document.documentElement.clientWidth; }  
    else if ( document.body ) { return document.body.clientWidth; }  
    return 0;  
}  

function getBrowserHeight  ( ) {  
    if ( window.innerHeight  ) { return window.innerHeight ; }  
    else if ( document.documentElement &&
document.documentElement.clientHeight != 0 ) { return
document.documentElement.clientHeight; }  
    else if ( document.body ) { return document.body.clientHeight; }  
    return 0;  
}  

//var _width = document.documentElement.clientWidth;
var _width = getBrowserWidth();

//var _height = document.documentElement.clientHeight;
var _height = getBrowserHeight();

/*        change code example end   */

Original issue reported on code.google.com by heeha0...@gmail.com on 27 Jun 2009 at 9:40

GoogleCodeExporter commented 8 years ago
This 'new' code does indeed work.
I had the position problem as well and this works!

Original comment by henkgies...@gmail.com on 30 Dec 2009 at 3:09