Move a window by 100 pixels in JavaScript

Description

The following code shows how to move a window by 100 pixels.

Example


<!--from   w ww.ja v a2s . c om-->


<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
<script type="text/javascript">

//move the window down by 100 pixels
window.moveBy(0, 100);

</script>
</body>
</html>

Click to view the demo

The code above generates the following result.

Move a window by 100 pixels in JavaScript