If you are just here to tell me on why resizing a window is a bad idea, obnoxious, and the web-equivalent of nails on a chalk board, then please go away. I am looking for a solution not a lecture. This is to be used in a intranet setting only. Specifically, to debug and then demo responsively designed web sites (sites that use media queries to scale) to clients for review via a web meeting. I want to demo specific break points. This is not to be unleashed on the general public.
Things I already know:
Possible Solution:
I need help with step 1. Everything else I can figure out. I'm also using jQuery and modernizer if that helps.
Thanks in advance for your help!
* Press Alt+Space to bring up the window menu, press S to choose the Size option, use the arrow keys to resize the window, and lastly Enter to confirm. * Click the Maximize button in the top right corner of the window.
The resizeTo() method is used to resizes a window to the specified width and height. Parameter Values: width: Sets the width of the window, in pixels. height: Sets the height of the window, in pixels.
The post is quite old, but here is a concrete implementation for future readers :
var resizeViewPort = function(width, height) { if (window.outerWidth) { window.resizeTo( width + (window.outerWidth - window.innerWidth), height + (window.outerHeight - window.innerHeight) ); } else { window.resizeTo(500, 500); window.resizeTo( width + (500 - document.body.offsetWidth), height + (500 - document.body.offsetHeight) ); } };
And if you want to take the scrollbars into account :
var resizeViewPort = function(width, height) { var tmp = document.documentElement.style.overflow; document.documentElement.style.overflow = "scroll"; if (window.outerWidth) { window.resizeTo( width + (window.outerWidth - document.documentElement.clientWidth), height + (window.outerHeight - document.documentElement.clientHeight) ); } else { window.resizeTo(500, 500); window.resizeTo( width + (500 - document.documentElement.clientWidth), height + (500 - document.documentElement.clientHeight) ); } document.documentElement.style.overflow = tmp; };
Have fun...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With