Screen Position with a new Window using percentages

Please note that official support for this menu version has now ceased. There are still plenty of users, though, and the forum is still running. Some of our long-time users may be able to help you out.
Post Reply
User avatar
MikieMouse
Beginner
Beginner
Posts: 2
Joined: Thu May 29, 2003 3:34 pm
Location: Colorado, USA
Contact:

Screen Position with a new Window using percentages

Post by MikieMouse »

I am able to use the screen position options without issue, though I can only get them to work with an exact value. For those that view the site on different display ranges, I was wondering if it is possible to set it to go down and right a certain percentage (to keep continuity). This is how I'm using the code:

Code: Select all

,"Main Book","javascript:openNewWindow(\"www.site.com\",650,300,\"top=10,left=10,scrollbars=yes\")",,"Description",0
Any help would be great. Thanx :mrgreen:
It only hurts when I pee
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Dear Mr. Mouse,

There are no native javascript positioning functions that use percentages. You'd have to alter your openNewWindow() function to get the user's current screen size, then calculate the absolute pixel positions for top and left based on the percentages you are interested in. You'll have to be more than passingly conversant with javascript to do this. You might also find some premade scripts that use percentages on some of the various javascript sites out there.

Hope that helps,

Kevin
Post Reply