PDA

View Full Version : Popover Window?


nurseryboy
11-17-2002, 04:29 AM
Hey guys, I am trying to figure out how to do this..
What this is, is, I want to have a link, and when I click on it, have it take me to another page, while having a popup window popup in front of the new page.
It sounds simple and probably is. I figured that the code I have would do it, but the popup window actually pops under the new page..
Heres what I have:

In the <head>:

<script language="JavaScript">
<!--
function popup(page) {
window.open(page,'popup','width=724,height=440,directories=no,menubar=no,status=no,location=no,resiz able=no,scrollbars=no,top=185,left=138');
}
//-->
</script>

In the <body>:

<a href="newpage.html" onClick="popup('popuppage.html')"><img src="images/image.gif"border="0"></a>

Could someone let me know how to have the popup steal the focus?
Thanks a lot,

Matthew

ez4ne12c
11-17-2002, 04:50 AM
I think you just do
popup.focus();

in your function

if you want a popup that keeps focus (always on top) i think you need to use a signed script .. last time i looked.
ez

nurseryboy
11-17-2002, 05:17 AM
lol.. Or I could just add onload="self.focus()"; to the popup page..
Oh well, it was worth the wait :)

whammy
11-17-2002, 05:09 PM
If you want to keep from putting body.focus() in the popup page, you need to create the popup window as an object, i.e.:

<script type="text/javascript">
<!--
function popup(page) {
popwin = window. open(page,'popup','width=724,height=440,directories=no,menubar=no,status=no,location=no,resizable=no ,scrollbars=no,top=185,left=138');
window.popwin.focus();
}
// -->
</script>

Ankun
11-18-2002, 05:52 AM
err uh so you want when you click a link for two windows to load right? one recycling the window the user clicked on and one opening in a new window? Its much simplier than that, simple use <a href="url you want to use in same window" onclick="window.open('url in new window')">

pretty easy.. unless i misunderstood :\

nurseryboy
11-18-2002, 01:09 PM
The problem was though.. keeping the popup window on top of the other (parent) window.
I think I have it figured out now.

Matthew

JohnTirone
12-20-2002, 03:51 PM
You mentioned that you solved this problem.

Could you share your example?

I'm having a similar problem.

Thank you!
John:confused:

nurseryboy
12-20-2002, 06:10 PM
Here is what I did.. and it seems to work for most browsers.
Put onLoad="self.focus();" in the <body> of the popup window.
Try that :)

Matthew

JohnTirone
12-20-2002, 07:36 PM
This doesn't keep the popup on top of the calling window ...
onLoad="self.focus();"

I'm testing with IE5 & NS6

I've also tried onblur="self.focus()" which ... works but with another problem:
On my popup, I have 2 select lists, which are unuseable
because of the onblur in the body ...

Any other suggestions?

nurseryboy
12-20-2002, 11:53 PM
I have no idea man..
I am no expert on javascript by any means.. lol, I was asking this question a while ago.
If I ever do find out how to make it work, I will let you know :)

Matthew

ez4ne12c
12-21-2002, 12:33 AM
I think you need a signed script and the you can set the window as always on top.. if that is what you need..
you set alwaysRaised=yes when you open the new window

personally i have not done this cause i couldnt be bothered
finding out about signed scripts but for security reasons i think this is the only way you can have a window always on top
ez