【发布时间】:2017-12-14 20:10:08
【问题描述】:
我在模型中有一个 iframe。 iframe 打开一个网站 eg.xxx 。从 xxx.com 我有多个按钮单击一个按钮,我被接管到 eg.xxx/yyy.html 。当我关闭对话框时,它仍然显示 xxx/yyy.html 而不是 xxx.com 。 我如何用 Javascript 解决这个问题?
部分模式代码:
<!-- Start Feature Section -->
<div class="section-modal modal fade" id="magazine-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-content">
<div class="close-modal " data-dismiss="modal">
<a href="../twt/index.html" style="color: #000000; font-size: 30px;" data-toggle="modal">
<i class="fa fa-home"></i>
</a>
<!-- <div class="lr">
<div class="rl">
</div>
</div>-->
</div>
<div class="container ">
<div class="row">
<div class="section-title text-center">
</div>
</div>
<div class="row modal-body">
<iframe src="https://www.pvrcinemas.com/magazines" target="_self" style="position:fixed; top:65px; left:0px; bottom:0px; right:0px; width:100%; height:95%;color:#000000; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;">
Your browser doesn't support iframes
</iframe>
</div>
</div>
</div>
</div>
<!-- End Feature Section -->
请帮助我。
【问题讨论】:
-
部分类似于stackoverflow.com/questions/46289527/…,其中刷新 scr 属性是通过 javascript 完成的。如果您在 iframe 中添加一个 id,它将更容易定位该 frame 。帖子链接还保留了通过 localstorage 完成的选择...也许这是您的下一个问题?
标签: javascript css html modal-dialog