window.moveTo() : Move the window to X, Y cooridnates

window.moveTo(X,Y);
We have seen how moveBy() we used and moved the child window to different locations. Same way we will try moveTo function and move the window to a different location.
DEMO of Move to
Here is the code.
<!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<title>Demo of moveto to move a window</title>q
<script language=javascript>

function to_close(){
tm.close();
}

function to_open(){
tm=window.open("moveby-child.htm","Ratting","width=250,height=150,0,top=200,status=0,");
}


function to_moveTo(){
tm.moveTo(300,300);
tm.focus();   // Keeping the focus on small window
}

</script>
</head>

<body>
<input type="button" name="btn" value="Open" onclick="to_open()";>
<input type="button" name="btn" value="Close" onclick="to_close()";>
<input type="button" name="btn" value="Move To" onclick="to_moveTo()";>
</body>

</html>
The code for child window is available at moveBy

Window Object Window resize to Redirect Page
Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com







    Post your comments , suggestion , error , requirements etc here




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer