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!

How do I open a window relative to the current window? 1

Status
Not open for further replies.

glendacom

MIS
Oct 23, 2002
36
US
I want to be able to open a new window (window.open) relative to the current window NOT the monitor screen? Is there a way to do this? The only attributes I can find that positions the new window are left and top which are relative to the monitor.

Thanks,
G
 
No. A new window is a new Instance of the browser. To pop things up inside a document window you need to use absolute position styles of block elements. Be warned you will likely find browser compatibility issues.

Good luck
-pete
 
thanks ... that is what I was afraid of. I'm lucky in that I won't run into the browser compatibility problem (since I only program for current IE - at least on this project) but I still don't think the time and effort to do the block elements will be worth the return.
 
If it's only for IE poping up block elements is a breeze

<html>
<head>
</head>
<body>
<input type=&quot;button&quot; value=&quot;Show&quot;
onclick=&quot;document.all('popup').style.display='block';&quot;/>
<div id=&quot;popup&quot;
style=&quot;display:none;
border: 1 solid #666666;
background-color: #cacaff;
position:absolute;
top:100;
left:100;
width:200&quot;>
<div>Line One</div>
<div>Line Two</div>
<div>Line Three</div>
<input type=&quot;button&quot; value=&quot;Hide&quot;
onclick=&quot;document.all('popup').style.display='none';&quot; />
</div>
</body>
</html>


:)
-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top