javascript - In an iframe subpage, the modal layer of the parent page opened through window.parent.document cannot be closed normally
阿神
阿神 2017-07-05 11:06:17
0
3
1061

Hello everyone, I would like to ask about opening the modal layer of the parent page through window.parent.document in the iframe sub-page, so that the modal closing method $("#modal").modal("hide") of the parent page cannot be closed normally. ,Does anyone know the reason for this

阿神
阿神

闭关修行中......

reply all (3)
学霸
你在子页面里$("#modal").modal("hide")肯定不能关闭呀! 你可以在子页面里调用父页面的一个方法,这个方法里写$("#modal").modal("hide")!
    漂亮男人

    $('#id', window.parent.document).modal('hide');

      phpcn_u1582

      Finally, we adopted a not-so-good method to solve it temporarily. Show first and then hide, $("#modal").modal("show").modal("hide"). This can solve the problem, but the pop-up layer is closed. Sometimes it will flash due to show, but I haven’t found a good solution yet

        Latest Downloads
        More>
        Web Effects
        Website Source Code
        Website Materials
        Front End Template
        About us Disclaimer Sitemap
        php.cn:Public welfare online PHP training,Help PHP learners grow quickly!