Click to See Complete Forum and Search --> : Linking from pop-up window to opener


ranthony
07-19-2003, 11:04 AM
Unlike you guys, I'm just a cut-and-paster. Now, I've run into a problem, and I'm hoping someone can 'splain it to me.

Using a centered pop-up window (http://simplythebest.net/info/javascript65.html) and a series of redirects within the pop-up window, I've designed a "virtual tour" of museums for a non-profit group here in Austin, Texas. One of the features was supposed to be that, when a visitor wants to learn more about one of the museums on the tour, they click a link in the pop-up window which loads a larger, more detailed page in the original (opener) window.

Now, that link (<a href="mypage.html" onClick="opener.location.href='mypage.html';return false">My Page</a>) works fine. But, I need the pop-up window to either blur (preferably) or close (acceptable) at the same time - in other words, to not interfere with the visitors view of the new page in the opener window - and, instead, it stays on top (i.e. is focused).

Everything I've tried doesn't work, and I'm beginning to think that I'm asking for a logical impossibility - that the act of clicking focuses the pop-up, and that's all she wrote. Any suggestions will serve a worthy cause - I promise! :confused:

Khalid Ali
07-19-2003, 11:43 AM
add
opener.focus(); in the onclick event

or if u want popup to close then add this in the event
self.close()

AdamGundry
07-19-2003, 11:44 AM
Just include window.blur() after setting the opener's location in your onclick event.

By the way, according to the WCAG (http://www.w3.org/TR/WCAG10/#gl-interim-accessibility) you should not be using popups.

Adam

Edit: Khalid got there first - sorry for posting on top of you. Actually, your method is probably better because it ensures the other window has focus, rather than just blurring the popup.