Open modal window from iframe to parent

I have a page with an iframe, and inside this iframe there are some links that should open a modal window in the parent window. The fact is that I do not have access to putting the code in the parent window. I just have access to this iframe. Is there a way to do this using jquery with such restrictions?

Thank!

+5
source share
1 answer

You can use jQuery SimpleModal plugin

"appendTo", , Modal. , iframe, .

$('#div-modal').modal({
    appendTo: $(window.parent.document).find('body'),
    overlayCss: {backgroundColor:"#333"}, // Optional overlay style
    overlayClose:true, 
});
// Set overlay width
$(window.parent.document).find('#simplemodal-overlay').css('width', '100%');

div, , , $('#div-modal') $(window.parent.document).find('#div-modal')

+6

All Articles