How to use Window Object ResizeTo in JavaScript
In this article I am going to explain about window object ResizeTo() Method in JavaScript.
JavaScript Window Object ResizeTo() Method
JavaScript ResizeTo() method is also use for resize the window size but the main purpose of of resizeTo() method is defined the fix size of window. Unlike resizeBy() if you click on button two time then window size will not be increase two time because its specifies fix size of window.
Syntax
Example
<html>
<head>
<script type="text/javascript">
var x;
function Winopen() {
x = window.open('', '', 'width=150,height=75');
x.focus();
}
function myfun() {
x.resizeBy(150, 100);
x.focus();
}
</script>
</head>
<body>
<button onclick="Winopen()">
open win</button>
<button onclick="myfun()">
Resize Win</button>
</body>
|
Output
After click on button
You may also want to read these related articles: here
Ask Your Question
Got a programming related question? You may want to post your question here