Window resizeBy() Method - Using the resizeBy() method together with resizeTo(): - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window resizeBy

Description

Window resizeBy() Method - Using the resizeBy() method together with resizeTo():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="openWin()">Create window</button>
<button onclick="resizeWinTo()">Resize the window to 800px * 600px</button>
<button onclick="resizeWinBy()">Make the new window smaller</button>

<script>
var myWindow;/*from w w w .java2  s  .  co m*/

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

function resizeWinTo() {
    myWindow.resizeTo(800, 600);
    myWindow.focus();
}

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

</body>
</html>

Related Tutorials