Forum Moderators: open

Message Too Old, No Replies

need help OnClick opens 2 pop windows

pop window

         

LeeThomas

10:26 pm on Mar 28, 2003 (gmt 0)

10+ Year Member



When you click on the thumb nail to open the pop window 2 pop windows containing the same information open up. One on top of the other. If you close the first window nothing happens then if you close the second window the pop window closes as well as the main browser window. Any help would be great.

This is the code I used:
<a href="example.htm" onClick="return openPhotoOneWindow()"

The function:
<line breaks added to features string to stop side scrolling -Tedster>

function openPhotoOneWindow() {
popWindow = window.open('example.htm',"popPhotoWindow",
"width=470,height=340,screenX=20,screenY=20,menubar=no,
resizable=no,scrollbars=no,dependent=yes");

popWindow.focus();
return false;

[edited by: tedster at 11:26 pm (utc) on Mar. 28, 2003]

tedster

11:38 pm on Mar 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, Lee.

First, I'd suggest adding onLoad=focus() to the body tag of the pop-up document -- and removing it from the function. Second, put ;return false; into the anchor tag, and also remove it from the function.

So now you have this anchor:
<a href="example.htm" onClick="return openPhotoOneWindow()"; return false;>

This body tag in the pop-up wondow's HTML document:
<body onLoad="focus()">

And this function definition:
function openPhotoOneWindow() {
popWindow = window.open('example.htm',"popPhotoWindow",
"width=470,height=340,screenX=20,screenY=20,menubar=no,
resizable=no,scrollbars=no,dependent=yes");
}

LeeThomas

12:05 am on Mar 29, 2003 (gmt 0)

10+ Year Member



Thank you