1

I want to resize the browser using my javascript or jquery code. I have tried by modifying window.InnerRadius value. Please

function resize() {
            window.innerWidth = 700;
        }
<button onclick="resize()">resize</button>

But it is not working. Is it possible to resize browser using JavaScript or jquery?

Sanjith
  • 289
  • 1
  • 3
  • 8
  • Possible duplicate of [Can I resize the browser window?](http://stackoverflow.com/questions/7022787/can-i-resize-the-browser-window) – Shoaib Chikate Mar 17 '17 at 09:35
  • Some browser vendors removed that feature from their JavaScript implementations, right around the time of the rick-roll, when they also removed the constant `alert()`'s popping up non-stop to prevent you from closing the page. – Mayazcherquoi Mar 17 '17 at 09:44

3 Answers3

1

Try doing this . Use resizeTo()

function resize() {
           window.resizeTo(250,250); //window.resizeTo(width,height);
        }
<button onclick="resize()">resize</button>
Gayathri Mohan
  • 161
  • 1
  • 10
0

This should do it, although - as you may know - it is not particularly recommended that this is done. It is detrimental to user experience, usually.

<script type="text/javascript">
    function changeScreenSize() {        
        window.resizeTo(screen.width-300,screen.height-500)   
    }
</script>

<body onload="changeScreenSize()">

This also might work:

window.resizeTo( width, height );

But as far as I understand it, there is NOT a way to resize the browser in Chrome.

mayersdesign
  • 5,062
  • 4
  • 35
  • 47
0

You can play with window's size provided if it is created using window.open(). Please refer this link https://developer.mozilla.org/en-US/docs/Web/API/Window/resizeTo, especially the NOTE: section.

Sree Nath
  • 543
  • 6
  • 19