Forum Moderators: open

Message Too Old, No Replies

Controlling the popup windows

popup window

         

sajannair

7:41 am on Jan 13, 2005 (gmt 0)

10+ Year Member



Hi,
I wanted some help on controlling the popup window. Actually what i want is that once a popup window is opened it does not get opened again and only the focus is shifted to the popup that is opened.
Can any one give me some useful tip on this?

adni18

1:00 pm on Jan 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



try the following:

var bee=0;
if(bee==0)
{
mainPop=window.open(a,b,c);
mainPop.focus();
window.setInterval("if(!mainPop.closed){mainPop.focus()}",10);
bee=1;
}

sajannair

4:14 am on Jan 14, 2005 (gmt 0)

10+ Year Member



No that didnt work. I think i am not able to explain my problem well. I have a thumnail image link on my page, on clicking on it a popup opens which shows the image in its original size...however when i click on it say 10 times 10 popups open, i want to restrict this and open the popup only once, put a check that if the popup is opened it does not open again.

Hope i am clear this time.

Rambo Tribble

6:21 am on Jan 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The second parameter in the window.open() command is the window name. If you use the same window name for each invocation of the command, the content will always go to the same window. Try this:

<a href="#" onclick="window.open('','win_name','');">open window</a>

sajannair

7:02 am on Jan 14, 2005 (gmt 0)

10+ Year Member



Thank You! That was so simple!