Go Back   Dynamic Drive Forums > DD Scripts > Dynamic Drive scripts help
Search Dynamic Drive Forums:

Reply
 
Thread Tools Search this Thread
  #1  
Old 02-02-2007, 03:43 AM
Eric Saboia Eric Saboia is offline
New Comer (less than 5 posts)
 
Join Date: Feb 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trying to close a window within itself.

Hi,

I'm using Popup Windows ( http://www.dynamicdrive.com/dynamicindex11/abox2.htm ), and I need to close a window generated by it within the window itself. I've tried to use hidebox(ID), but it only works on a opened popup. Can anyone help me?

Thanks.

Regards,

Eric Saboia
Reply With Quote
  #2  
Old 02-02-2007, 04:38 AM
jscheuer1's Avatar
jscheuer1 jscheuer1 is offline
No Kidding?
 
Join Date: Mar 2005
Location: SE PA USA
Posts: 19,000
Thanks: 19
Thanked 1,135 Times in 1,121 Posts
Blog Entries: 3
Default

Why would you want to close an unopened pop up?
__________________
WWWWWWWWWWWW
- John
________________________

Really Show Your Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Reply With Quote
  #3  
Old 02-02-2007, 12:34 PM
Eric Saboia Eric Saboia is offline
New Comer (less than 5 posts)
 
Join Date: Feb 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I should right opener (parent document) and not opened. Im sorry.
Reply With Quote
  #4  
Old 02-02-2007, 03:55 PM
jscheuer1's Avatar
jscheuer1 jscheuer1 is offline
No Kidding?
 
Join Date: Mar 2005
Location: SE PA USA
Posts: 19,000
Thanks: 19
Thanked 1,135 Times in 1,121 Posts
Blog Entries: 3
Default

I'm still not clear on where you are trying to do what from.

I think the what is - close a pop up pseudo window created by this script.

I think where is from some other window other than the one in which the pop up pseudo window created by this script resides.

Cross window scripting is fairly easy but, can get tricky when windows are opened and closed and/or reused after being initially created. The basic idea is that anything on the child window can be accessed from the opener if it was opened using javascript and assigned a variable at that time:

Code:
var mynewwin=window.open('some.htm');
Now, from the page (not the window) that opened some.htm in this manner, things on some.htm become (for example its document.title becomes):

Code:
mynewwin.document.title
Going in the other direction is even easier. To access something on the parent window from the child, it makes no difference how the child was opened, the parent is always (on the child window's page) the opener. The parent's title would be (from the child):

Code:
opener.document.title
__________________
WWWWWWWWWWWW
- John
________________________

Really Show Your Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Reply With Quote
  #5  
Old 02-02-2007, 08:41 PM
Eric Saboia Eric Saboia is offline
New Comer (less than 5 posts)
 
Join Date: Feb 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

index.php:
new popUp(0, 0, 773, 385, unique, "<iframe src='"+acao+"_prod.php?id_prod="+id_prod+"&id_div="+unique+"' name='main' width='100%' height='100%' marginheight='1' scrolling='Auto' frameborder='0' id='main'></iframe>", "white", "black", "bold 10pt sans-serif", "Informações do produto", "navy", "white", "#dddddd", "gray", "black", true, false, false, true, false);

I want to close (or hide) the popUP using a link inside the acao_prod.php (iframe link thats loaded inside the pseudo window). Just like the [x] on titlebar of pseudo window.

Sorry for the bad english..
Reply With Quote
  #6  
Old 02-02-2007, 09:13 PM
jscheuer1's Avatar
jscheuer1 jscheuer1 is offline
No Kidding?
 
Join Date: Mar 2005
Location: SE PA USA
Posts: 19,000
Thanks: 19
Thanked 1,135 Times in 1,121 Posts
Blog Entries: 3
Default

That's a little different. You are not dealing with an opener or with a child window created as I indicated. You can still do it. What you have is a parent page:

index.php

and a child iframe:

Code:
<iframe src='"+acao+"_prod.php?id_prod="+id_prod+"&id_div="+unique+"' name='main' width='100%' height='100%' marginheight='1' scrolling='Auto' frameborder='0' id='main'></iframe>
This child iframe contains a page:

acao_prod.php

on acao_prod.php things on index.php would be parent.object so, from my previous example, index.php's title would be from acao_prod.php:

parent.document.title

and what you seem to be after would be:

parent.hidebox(ID)
__________________
WWWWWWWWWWWW
- John
________________________

Really Show Your Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Reply With Quote
  #7  
Old 02-02-2007, 11:46 PM
Eric Saboia Eric Saboia is offline
New Comer (less than 5 posts)
 
Join Date: Feb 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks!!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:54 AM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.