A remote control for moving a window
Here is a tip that isn't necessarily very useful, but shows how to use the javaScript function
moveBy(). It consists of simply adding a form to your page and associating each of its buttons to a movement of the browser window.
Maybe you can make a game out of it!
First, copy this script in the header of your page, between the tags
<HEAD> and
</HEAD>:
<SCRIPT LANGUAGE="JavaScript">
<!--
function moveWindowLeft() {
window.moveBy(-15, 0);
window.moveBy(0, 0);
}
function moveWindowRight() {
window.moveBy(15, 0);
window.moveBy(0, 0);
}
function moveWindowUp() {
window.moveBy(0, 0);
window.moveBy(0, -15);
}
function moveWindowDown() {
window.moveBy(0, 0);
window.moveBy(0, 15);
}
// -->
</script>
Here, we decided to move our window by
15 pixels with each click. You can always choose a higher or lower value.
Next define the control form in the body of your page, between the
<BODY> tags of
</BODY>:
<form>
<input type=button value="Top" onClick="moveWindowUp();">
<input type=button value="Left" onClick="moveWindowLeft();">
<input type=button value="Right" onClick="moveWindowRight();">
<input type=button value="Bottom" onClick="moveWindowDown();">
</form>
Use your favorite presentation for the various buttons. You can always create a table to display these buttons
in the form of a cross.
Discover all Webmaster tips.