Window resizeBy() Method - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window resizeBy

Description

The resizeBy() method resizes a window relative to its current size.

Parameter Values

Parameter Type Description
width Number Required. A positive or a negative number in pixels to resize the width by
heightNumber Required. A positive or a negative number in pixels to resize the height by

Return Value:

No return value

The following code shows how to Open a new window, and resize the width and height 250px relative to its current position:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="resizeWin()">Resize window</button>

<script>
function resizeWin() {//from   www .ja v a 2s  .  c o m
    top.resizeBy(100, 100);
}
</script>

</body>
</html>

Related Tutorials