| Issue 3: | Close button for modal dialog with iframe content | |
| 5 people starred this issue and may be notified of changes. | Back to list |
If you are loading iframe content in the nyroModal window and have set modal to be true, I believe the close button html should still be written to the outer window. Because you are in an iframe, you no longer have access to the main page to create a 'close' link.
Apr 15, 2008
Project Member
#1
nyro...@gmail.com
Apr 15, 2008
(No comment was entered for this change.)
Labels:
-Type-Defect Type-Other
May 16, 2008
Hey, and what about crossdomain issues? What if I load Iframe from different host? I'm pretty sure you will get Access denied error trying to access parent object
Jun 3, 2008
You're right Maxim, a security error is thrown when trying to do that. I've no idea how we could do that in a cross domain perspective. If you have any idea, I'll try.
Jun 5, 2008
I know there is one way to interact between iframes in different domains. You can
change parent location, but only by adding "#xxxxxx" part to it. Important thing you
must know parent URL in the Iframe or transfer it to Iframe in query string. Because
trying to check value of parent.location.href will give you security warning...
Something like that:
1. Create iframe with src=sIframeHref+"?ParentUrl="+escape(document.location.href);
2. In the Iframe add the follwing action to close button:
parent.location = RequestQueryParam("ParentUrl") + "#closeMe";
The above line will NOT give you security error.
Now in the parent window check location every X miliseconds and close modal
if "#closeMe" was found.I have this implemented in one of my sites...
Jun 5, 2008
Wouch, sounds like a hack... The only thing I don't like in this solution is the checking every "X miliseconds". Do you know a way to triger an event or anything from the iframe to let know the parent that it should close the modal?
Feb 24, 2009
I also need to set modal=true but want the close button to stay. Why not make an extra setting, like modelShowClose, if model=true, check the modelShowClose setting and if it is also true, show the close button. Otherwise, show it as it does now...
Apr 15, 2009
Or use parent.$.nyroModalRemove(); in function.
May 28, 2009
I solved showing close button in iframe with css = Absolute Positioning.
Aug 18, 2009
I loading iframe content in the nyroModal window and have set modal to be true, The iframe content: <div class="error">已经访谈在直播列表里,无法直播。<a href="javascript:void(0)" class="nyroModalClose">关闭</a></div> when i click the close link,the nyroModal window cann't close. onclick="parent.$.nyroModalRemove(); can close the nyroModal window happy
Apr 16, 2010
(No comment was entered for this change.)
Status:
WontFix
Jun 30, 2011
well, you can still use a simple link: <a href="parentPage.html" target="_parent">Close Window</a> and the iframe will disappear. you just won't get the fading effect. |