resizeTo(x,y) and resizeBy(xDelta,yDelta)
In this chapter you will learn:
Resize a window
The browser window can be resized using the resizeTo()
and resizeBy()
methods.
resizeTo()
expects a new width and height and
resizeBy()
expects the differences in each dimension.
<!DOCTYPE HTML> <!-- j a va2 s.c o m-->
<html>
<body>
<script type="text/javascript">
//resize to 100 x 100
window.resizeTo(100, 100);
//resize to 300 x 300
window.resizeTo(300, 300);
//resize to 200 x 150
window.resizeBy(100, 50);
</script>
</body>
</html>
Next chapter...
What you will learn in the next chapter:
Home » Javascript Tutorial » Window