Definition and Usage..
The resizeTo() method resizes a window to the specified width and height.
Return Value: No return value
Syntax : resizeTo(width, height)
Differents way how to declare resizeTo() Method in program.
CODING:The resizeTo() method resizes a window to the specified width and height.
Return Value: No return value
Syntax : resizeTo(width, height)
Differents way how to declare resizeTo() Method in program.
<!DOCTYPE html>
<html>
<body>
<p>Open a new window, and resize the width and height to 500px:</p>
<button onclick="openW()">New window</button>
<button onclick="resizeWTo()">Increse Resize</button>
<button onclick="resizeWTode()">Decrese Resize</button>
<script>
var newWindow;
function openW() {
newWindow = window.open("", "", "width=0, height=0");
newWindow.document.write("<p>This is newWindow click resize button and resize the newWindow.</p>");
newWindow.resizeTo(250, 250);
}
function resizeWTo() {
newWindow.resizeTo(500, 500);
newWindow.focus();
}
function resizeWTode() {
newWindow.resizeTo(-50, -50);
newWindow.focus();
}
</script>
</body>
</html>
<html>
<body>
<p>Open a new window, and resize the width and height to 500px:</p>
<button onclick="openW()">New window</button>
<button onclick="resizeWTo()">Increse Resize</button>
<button onclick="resizeWTode()">Decrese Resize</button>
<script>
var newWindow;
function openW() {
newWindow = window.open("", "", "width=0, height=0");
newWindow.document.write("<p>This is newWindow click resize button and resize the newWindow.</p>");
newWindow.resizeTo(250, 250);
}
function resizeWTo() {
newWindow.resizeTo(500, 500);
newWindow.focus();
}
function resizeWTode() {
newWindow.resizeTo(-50, -50);
newWindow.focus();
}
</script>
</body>
</html>
Comments
Post a Comment