stefangabos / Zebra_Dialog

A small, compact, and highly configurable jQuery plugin for creating beautiful modal dialog boxes
https://stefangabos.github.io/Zebra_Dialog/flat.html
Other
155 stars 67 forks source link

How close modal in parent window from inside an iframe? #10

Closed nadymain closed 7 years ago

nadymain commented 7 years ago

parent.???.close();

thanks.

stefangabos commented 7 years ago

you'll have to assign the dialog box to a variable in the parent window, like

var dialog = new $.Zebra_Dialog()

from the iFrame you'd use

parent.dialog.close()
nadymain commented 7 years ago

parent window:

var $dialog;
$('.btnImage').on('click', function(e) {
    e.preventDefault();
    $dialog = new $.Zebra_Dialog({...});
});

iframe:

$('.select').click(function(){
    ...
    parent.$dialog.close();
});

thanks.