Browser Window Size and Position
4. Add to Your Page
Join the Discussion
More of this Feature
All that remains to be done now is to reference the fields within your Javascript.
if you want to add an extra column to the right of your page if the page is over a certain width (say 800 pixels) then you include the code for that column in an if statement that tests the page width like this:
// code for extra column goes here
}
If you want to test if a given object has moved outside of the browser window we might use code like this:
obj.right > posRight() ||
obj.top < posTop() ||
obj.bottom > posBottom()) {
// not fully visible on screen
}
Another thing you may want to do is toplace an object in a particular position in the window independently of the scroll position of the page. Let's say we want the object to be down 50 pixels and across 100 pixels from the top left corner of the window. Here's code to do this.
obj.left = posLeft() + 100;
I have found lots of uses for these functions and I am sure that you will too.

