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

Focusing new window in NN6

Status
Not open for further replies.

avivit

Technical User
Jul 5, 2000
456
IL
NN6 problem only:
I have links in a page and when choosing one fot the first time, it opens
a new window and focusing it, as I requested.
But When I try to open another one, it opens the site in the same new window,
but most of the time, the focus stays on the opener.
It seems as the "wind.focus" does not work. possible?
No problem in IE or NN previous to the 6th version.

if (NS)
{ wind=window.open(url,"win",'screenx=0px,screeny=0px,width=400,height=400,resizable,menubar,titlebar,toolbar,scrollbars,location');
}
else if (IE)
{wind=window.open(url,"win",'left=0px,top=0px, width=400 ,height=400,resizable,menubar,titlebar,toolbar,scrollbars,location');
}
wind.focus();
 
try using a setTimeout to focus the window...not sure if that will work... jared@aauser.com
 
Or put the focus() in the child window.

<body onLoad=&quot;focus()&quot;>

That will be more reliable in that you know it will focus as soon as it loads, whereas the setTimeout is arbitrary and may work sometimes but not others.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Thanks guys:
Tom, I will sure try it in the cases where I can control the content of the new window, but in the current problem, the new window holds another site's content (url=&quot;httpL// so I can't implement it.

Jaredn, I'm not sure it's a good idea to try it, in my case,
because the page is already &quot;heavy&quot;, and it looks as if &quot;set time out&quot; will make the page even &quot;heavier&quot;. Am I right?
 
it won't make it &quot;heavier&quot; you said you tried to use window.focus() already, so I figured maybe in your case (or NS6?) when a parent opens a child window, it steals back focus. Just a suggestion :) jared@aauser.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top