简体   繁体   中英

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.

here is my jsfiddle

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. refer this .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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