简体   繁体   English

如何使用从iframe加载的click事件关闭引导程序模式

[英]How to close a bootstrap modal using the click event loaded from iframe

I have loaded a url in iframe inside a bootstrap modal, I am trying to closemodal box using the class name which is loaded from the iframe url. 我已经在引导模态中的iframe中加载了一个网址,我正在尝试使用从iframe url中加载的类名来关闭模式框。

here is my jsfiddle 这是我的jsfiddle

https://jsfiddle.net/fxfbzn7L/1/ https://jsfiddle.net/fxfbzn7L/1/

and my code goes here 我的代码在这里

$('#terms_con').click(function () {
            $('#termsCondition').modal({
                show: true
            });
        });



         $('#termsCondition .btn-close').click(function () {
             $("#termsCondition").modal("hide");
            });

You can create a false div on the iframe close button and add and event listener on the div to close the window. 您可以创建在一个虚假的div iframe关闭按钮,以及添加和事件侦听器的div关闭窗口。 refer this . 请参考这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM