I want to resize my browser window using Javascript to test my responsive webpage design functionality. But I didn't find any option for the same.
What I found is, we can modify window size for newly pop up window as shown below:
<body>
<p>Open a new window, and resize the width and height to 500px:</p>
<button onclick="openWin()">Create window</button>
<button onclick="resizeWin()">Resize window</button>
<script>
var myWindow;
function openWin() {
myWindow = window.open("", "", "width=100, height=100");
}
function resizeWin() {
myWindow.resizeTo(250, 250);
myWindow.focus();
}
</script>
</body>
I have defined some responsive behaviour using following css code:
@media screen and (max-width: 500px){
//style changes
}
Can we resize browser window where our page is launched? Or it is not possible?