Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

popup window location Java Script

Status
Not open for further replies.

vree

IS-IT--Management
Dec 31, 2002
49
US
Let's say I have four hyperlinks on a webpage.
The first in the top 25% of the page, the second at the middle, the third at 75% and the 4th at the bottom,
if each one of these hyperlinks opens a new window, how do i get the popup to stay in the same location as the hyperlink, I want it to open with out the "main" page moving?

I am using this right now, and know it moves the window top left, but can't figure out how to make it stay put in relation to the link.
<a href=&quot;#&quot;onclick=&quot;javascript:window.open('1stwindow.html','firstwindow','width = 400, height = 450, scrollbars=yes,right=30,top=30,resizable=yes')&quot;>Open First Window
</a>
 
[tt]<a href=&quot;1stwindow.html&quot; onclick=&quot;javascript:window.open('1stwindow.html','firstwindow','width=400, height=450, scrollbars=yes,right=30,top=30,resizable=yes');return false;&quot;>Open First Window
</a>[/tt]

The href should link to the page you wish to open rather than #. The 'return false' then tells the browser not to go to the hyperlink but rather execute the javascript code only. Your main page should then not jump around the place.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top