I want resize browser window to 1000×700 pixel by default on load of html page. Also whenever you resize window the minimum dimension 1000×700 should be maintained. I tried
window.onresize = function(){
window.resizeTo(1000,700);
};
but in IE8 its not working giving error “Access denied”, however in FF its work fine.
Please guide me with some alternate solution that can be handled using JS
It’s disabled by default in IE. And Chrome. And Opera. It can be disabled in Firefox too. There is a very good reason for this, namely that it’s absolutely obnoxious. Everyone hates having their browser tampered with.
You can’t stop the window being resized either, thank goodness, short of trapping
onresizeand callingresizeToin response, for the last few browsers where that will do anything.If you want a window that’s a specific size, you can try
window.opening a new one in that size. You can even ask for it to be unresizable. Although, again, many browsers will simply ignore your unreasonable user-hostile request.