How to use Window object MoveBy in JavaScript

In this article I am going to explain about Window object MoveBy() Method.
  • 2236

JavaScript Window Object MoveBy() method

JavaScript MoveBy() method use for move an window in any direction. Move direction of window is set by defined the pixel number.

Syntax

 

Window.MoveBy(X,Y)

Example

In this example when you will click on open win button then a new window will be open and when you will click on move win the window will be move .

<html>

<head>

    <script type="text/javascript">

        function winopen() {

            Win = window.open('', '', 'width=300,height=75');

            Win.document.write("<p>click move to move window</p>");

        }

 

        function winmove() {

            Win.moveBy(100, 100);

            Win.focus();

        }

    </script>

</head>

<body>

    <button onclick="winopen()">

        Win Open</button>

    <button onclick="winmove()">

        Win Move</button>

</body>

</html>

 

Output

 

moveby.gif


You may also want to read these related articles: here
 
Ask Your Question 
 
Got a programming related question? You may want to post your question here
 

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.