HTMLGuyLLC / jAlert

jQuery alert/modal/lightbox plugin
https://htmlguyllc.github.io/jAlert/
MIT License
76 stars 35 forks source link

Close jAlert from iframe #36

Closed robyone67 closed 7 years ago

robyone67 commented 7 years ago

Hello, if I display an iframe with jalert, how can i programmatically close the jalert box with a command in the page displayed by jalert? In short, in the page displayed in the iframe, there must be a button that executes a command like window.parent.jAlert.closeAlert() or something like that: what is the exact syntax? Thank you.

HTMLGuyLLC commented 7 years ago

I don't really have time to help with implementation questions, but off the top of my head...I think you can create a method in the parent window like:

function closeTopAlert()
{
   $.jAlert('current').closeAlert(); 
}

then call

window.parent.closeTopAlert();