Definition and Usage..
The resizeBy() method resizes a window by the specified amount, relative to its current size.
Note: This method moves the bottom right corner of the window by the specified number of pixels defined. The top left corner will not be moved (it stays in its original coordinates).
Return Value: No return value
Syntax : resizeBy(width, height)
Differents way how to declare resizeTo() Method in program.
CODING:The resizeBy() method resizes a window by the specified amount, relative to its current size.
Note: This method moves the bottom right corner of the window by the specified number of pixels defined. The top left corner will not be moved (it stays in its original coordinates).
Return Value: No return value
Syntax : resizeBy(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="resizeWToin()">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.resizeBy(50, 50);
}
function resizeWToin() {
newWindow.resizeBy(100, 100);
newWindow.focus();
}
function resizeWTode() {
newWindow.resizeBy(-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="resizeWToin()">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.resizeBy(50, 50);
}
function resizeWToin() {
newWindow.resizeBy(100, 100);
newWindow.focus();
}
function resizeWTode() {
newWindow.resizeBy(-50, -50);
newWindow.focus();
}
</script>
</body>
</html>
Comments
Post a Comment