Welcome visitor
* Login
* Register
It is currently July 15th, 2019, 8:06 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » HTML



Post new topic Reply to topic  [ 4 posts ] 
Author Message
  Focus on the popup window until parent window is closed
PostPosted: December 12th, 2009, 12:59 am 

Posts: 30
Do you know how would it be possible to have a popup window that is not seen until the paren window is closed? Or is it too pointless?


Top
 Profile  
 
  Re: Focus on the popup window until parent window is closed
PostPosted: December 12th, 2009, 1:47 am 

Posts: 48
Why dont you open the popup when they leave your site?
<body onunload="window.open('http://www.scriptingok.com','_blank');">


Top
 Profile  
 
  Re: Focus on the popup window until parent window is closed
PostPosted: December 12th, 2009, 8:45 am 

Posts: 30
Thanks but that wont work on firefox, but really, I appreciate it. Any other ideas cross browser compatible?


Top
 Profile  
 
  Re: Focus on the popup window until parent window is closed
PostPosted: December 14th, 2009, 4:58 pm 
User avatar

Posts: 79
Ok, this is a solution I found on the web. After you create the popup window at any time this code will only let you focus it when the opener window is closed. So yes, you should be able to access the code of the popup-window.

<body onfocus="checkparent();">
<script type="text/javascript">
function checkparent(){
  if (window.opener != null && !window.opener.closed)
    {this.blur();}
  else
    {}
}
</script>


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

FORUMS » Client Side » HTML


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron