Window resizeBy() Method - Open a new window, and decrease the width by 50px and increase the height by 50px: - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window resizeBy

Description

Window resizeBy() Method - Open a new window, and decrease the width by 50px and increase the height by 50px:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

<script>
var myWindow;/*from w  w w  . j av a2 s.c  o  m*/

function openWin() {
    myWindow = window.open("", "", "width=500, height=500");
}

function resizeWin() {
    myWindow.resizeBy(-50, 50);
    myWindow.focus();
}
</script>

</body>
</html>

Related Tutorials