Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

chrome resize window javascript

// SEE https://stackoverflow.com/a/7452099/8251524 for important facts
// about limitations when used beyond development.

if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1)
    var t = setTimeout("resize()", 200);
else
    resize();

function resize() {
    var innerWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
    var innerHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
    var targetWidth = 800;
    var targetHeight = 600;
    window.resizeBy(targetWidth-innerWidth, targetHeight-innerHeight);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #chrome #resize #window #javascript
ADD COMMENT
Topic
Name
2+3 =