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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

target=_blank not specific enough

Status
Not open for further replies.

RickWolff

Technical User
Apr 28, 2003
23
0
0
US
I have a main page with links, each link opening another page in another window, without closing the first window, and scrolling to an anchor. Yes, I used _blank in the link, and my anchors work, but I'd like to be more specific in two ways:
1. I'd like to tell the second window using HTML (not JavaScript if I can avoid it) its size and position relative to the first window. (I know I've seen it done somewhere.)
2. When the user goes back to the first page without closing the second and hits another link to take him to another anchor on the second page, the second window should activate, as opposed to a third window with a copy of the second page in it, which is what it does now.
You can see what my problem is:
I really looked at previous threads, and if they have the answer, I can't tell. Thanks for your help.
 
To solve #2 you have to name the windows rather than use _blank.

on #1, i don't think you can control the browsers attributes without using javascript. Hopefully if i am wrong someone will correct me!

-pete
[sub]I just can't seem to get back my IntelliSense[/sub]
 
Thank you. #2 was worrying me more than #1.
Regarding #1: Oh, okay, what's the JavaScript?
Note: I'm working with Dreamweaver 3, but I'm not afraid of code ... very much.
 
To get a hold of the window's position:

browserX = window.screenTop;
browserY = window.screenLeft;

To grab the size:

browserHeight = document.body.offsetHeight;
browserWidth = document.body.offsetWidth;

Do whatever you have to do to arrive at the appropriate x, y, height and width for your new window then call:

winOpen = window.open('/yoururl.html','winOpen','width=YourNewWidth,height=YourNewHeight);

winOpen.moveTo(newX, newY);

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top