距开课0天0时0分-10220395秒
阿神2017-07-05 11:06:17 0 3 525
[JavaScript讨论组]举报回复话题 ↕
大家好 我想问一下 在iframe子页面 通过window.parent.document打开父页面的modal层,这样父页面的modal关闭方法$("#modal").modal("hide")不能正常关闭,有没有大神知道这是什么原因
3
0
分享
欧阳克 2017-07-05 11:08:173楼
你在子页面里$("#modal").modal("hide")肯定不能关闭呀! 你可以在子页面里调用父页面的一个方法,这个方法里写$("#modal").modal("hide")!
赞 +0添加回复
漂亮男人 2017-07-05 11:08:172楼
$('#id', window.parent.document).modal('hide');
phpcn_u1582 2017-07-05 11:08:171楼
最后采取了一种不太好的方法暂时解决,先show再hide,$("#modal").modal("show").modal("hide"),这样可以解决,只是弹出层关闭的时候会因为show闪一下,还没有找到好的解决办法
欧阳克 2017-07-05 11:08:173楼
赞 +0添加回复
漂亮男人 2017-07-05 11:08:172楼
$('#id', window.parent.document).modal('hide');
赞 +0添加回复
phpcn_u1582 2017-07-05 11:08:171楼
最后采取了一种不太好的方法暂时解决,先show再hide,$("#modal").modal("show").modal("hide"),这样可以解决,只是弹出层关闭的时候会因为show闪一下,还没有找到好的解决办法
赞 +0添加回复