Return to Snippet

Revision: 1049
at September 4, 2006 17:38 by Corhol


Initial Code
// getBrowserWidth() by Cameron Adams
// http://www.themaninblue.com/experiment/ResolutionLayout/
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;
}

Initial URL


Initial Description


Initial Title
getBrowserWidth() by Cameron Adams

Initial Tags
javascript, window

Initial Language
JavaScript