How to make manual clos开发者_如何学Goe link on nyroModal iFrame ?
i try to use this code. but , it's seem just for v.1
<a href="#" onclick="parent.$.nyroModalRemove(); return false;">Close From Iframe</a>
Help me please~ I'm very new for jQuery don't know how to customize code.
The nyromodal has a default funcitonality to look for a class (nyroModalClose) and if an element has this class use it as a close link.
So Instead of:
<a href="#" onclick="parent.$.nyroModalRemove(); return false;">Close From Iframe</a>
Try:
<a href="#" class="nyroModalClose">Close From Iframe</a>
Ofcourse you can try to select to top modal and close it with:
<a href="#" onclick="$.nmTop().close();">Close From Iframe</a>
I am having better luck closing the iframe from within the iframe programatically with this
<a href="#" onclick="parent.$.nmTop().close();">Close From Iframe</a>
Here is my solution, I used it in my project now:
var win = window.dialogArguments || opener || parent || top;
win.$('.nyroModalClose').click();
as you mentioned ,you can do like this:
<a href="#" onclick="win.$('.nyroModalClose').click();return false;">Close From Iframe</a>
I've experienced a similar issue with nyromodal dialog boxes appearing to not close/open properly. The $.nyroModalRemove()
actually worked ok, as did class="nyroModalClose"
.
The problem turned out to be with IE (7 and 8) caching AJAX requests. So, the next time you've tried to populate nyromodal from an AJAX request, it won't resubmit but will try to reuse the cached request results instead, but because it has already been removed by the nyroModalRemove()
it will just appear as if nyromodal didn't load.
Appending ¶mx=Math.random()
to the end of the AJAX URL fixes the issue.
精彩评论