You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

overlay api.close not work on iframe Created Jul 29, 2010

This thread is solved

Views: 1805     Replies: 2     Last reply Aug 12, 2010  
You must login first before you can use this feature

ovii

Posts: 1

Registered:
Jul 29, 2010

overlay api.close not work on iframe

Posted: Jul 29, 2010

<script language="javascript" type="text/javascript">
	$(document).ready(function(){
		/*-----jquery tools. overlay-----*/
		$(function() {
			overlayapi = $("a[rel]").overlay({
				expose: '#fff',
				effect: 'apple',
				api: true,
				onBeforeLoad: function() {
					// grab wrapper element inside content
					var wrap = this.getContent().find(".contentWrap");
					// load the page specified in the trigger
					wrap.load(this.getTrigger().attr("href"));
				}
			});
		});
		/*-----jquery tools. overlay-----*/
	});//jquery ready
	</script>
<div class="jqtools_overlay" id="overlay"><div class="contentWrap"></div></div>

this make overlay to load page it work in this step.
the page in overlay is iframe that open library page.

this is in library page

<script language="javascript">
function addmedia(tagadd, closewin) {
// some addtag script
if (closewin == "yes") {
var overlayapi = $("#overlay").overlay({api: true});
overlayapi.close();
}
}
</script>
<a onclick="addmedia('<img>','yes');">add</a>

so, <img> tag was added but overlay didnot close.
i'm stuck on this.please help.

pashaweb

Posts: 1

Registered:
Aug 10, 2010

Same problem

Posted: Aug 10, 2010

Reply to: overlay api.close not work on iframe, from ovii
I can't close overlay from function

geordiep

Posts: 5

Registered:
May 4, 2010

» overlay api.close not work on iframe

Posted: Aug 12, 2010

Reply to: overlay api.close not work on iframe, from ovii
I struggled with this issue as well and came up with a solution. Create a function in the parent document to trigger a .click() event on the generated close button and call it from the iframe using window.parent.FunctionName();

For detailed instructions go to my post here:
http://flowplayer.org/tools/forum/40/47615#post-47615