Welcome to Bucaro TecHelp!

Bucaro TecHelp
Maintain Your Computer and Use it More Effectively
to Design a Web Site and Make Money on the Web

About Bucaro TecHelp About BTH User Agreement User Agreement Privacy Policy Privacy Site Map Site Map Contact Bucaro TecHelp Contact RSS News Feeds News Feeds

Victims of Sandy Hook

Stop the Slaughter of Innocents. Congress is bought and paid for by gun lunatics and gun promotion groups. If you want to live in a safe America, help buy Congress back for America. Send a donation to Mayors Against Illegal Guns, 909 Third Avenue, 15th Floor New York, NY 10022

Use moveBy Method to Move Window by a Specific Offset

In this article, I show you how to use Java Script to move a window from its current position to a new position by an offset number of pixels. To accomplish that, I will use the window object's moveBy method. Click on the link below to create a window.

Create Window

I used a variable named moveBYwin in the window.open method to create the window. We can use that variable name to control the window. Shown below is code to move the window 20 pixels to the right and 20 pixels down.

<a href="#" onclick="moveBYwin.moveBy(20,20);">Move Window</a>

Click on the link below to move the window. It will move 20 pixels to the right and 20 pixels down each time you click the link.

Move Window

When you click on the link, it gives the focus to the window with the link, so your browser window may hide the moveBYwin window. In that case, click on the link below to move it to the top where you can see its new location.

Move to Top

Eventually, you may want to close the moveBYwin window. To do that click in the link below.

Close Window

If you want to move a window to a specific loation on the screen, then you're looking for the moveTo method.

More Java Script Code:
• Java Script Arithmetic Operators
• Java Script Trigonometric Methods
• Include a Quote Character in a String
• Java Script Math.tan Method
• The Browsers History Object
• Rounding a Number with JavaScript
• A Brief History of JavaScript
• Extract Part of a String
• Remove Blank Spaces From Ends of a String
• JavaScript Operators

RSS Feed RSS Feed

Follow Stephen Bucaro Follow @Stephen Bucaro

Fire HD
[Site User Agreement] [Privacy Policy] [Site map] [Search This Site] [Contact Form]
Copyright©2001-2017 Bucaro TecHelp 13771 N Fountain Hills Blvd Suite 114-248 Fountain Hills, AZ 85268