用Bootstrap架構彈出iframe頁面 在彈出的模態框中載人iframe頁面,bootstrapiframe

來源:互聯網
上載者:User

用Bootstrap架構彈出iframe頁面 在彈出的模態框中載人iframe頁面,bootstrapiframe
HTML代碼:

<div class="modal fade" id="NoPermissionModal">    <div class="modal-dialog" >        <div class="modal-content">            <div class="modal-header">                <%-- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>--%>                <button type="button" class="close" onclick="window.history.go(-1);">×</button>                <h4 class="modal-title" id="NoPermissionModalLabel">系統訊息</h4>            </div>            <div class="modal-body">                <iframe id="NoPermissioniframe" width="100%" height="50%" frameborder="0"></iframe>            </div>            <div class="modal-footer"><%--                <button type="button" class="btn btn-default " data-dismiss="modal">    關  閉    </button>--%>                <button class="btn btn-default"  type="button" onclick="window.history.go(-1);" >    關  閉    </button>            </div>        </div>    </div></div>  <input type="button" value="彈出模態框iframe" class="btn btn-primary" id="btnclick" ><img src="http://img.blog.csdn.net/20140923180316546?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2hpbmFwbGFu/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />

Js代碼:
$(function(){    $("#btnclick").click(function(){        var frameSrc = "../ErrorPages/NoPermission.html";        $("#NoPermissioniframe").attr("src", frameSrc);        $('#NoPermissionModal').modal({ show: true, backdrop: 'static' });    });});


:








iframe中嵌入一個jsp頁面,需要在iframe中彈出一個div層,可是這個div不可以超出iframe的範圍

思路:
把div層定義在父視窗中,彈出div功能定義為一個方法popupDiv;在iframe頁面調用父視窗的方法:
window.parent.popupDiv()。
 
iframe中嵌入一個jsp頁面,需要在iframe中彈出一個div層,可是這個div不可以超出iframe的範圍 你問題解決了

iframe中的彈出層無法彈到外面去的。

要實現這種彈出層,只有一種思路,就是把你要彈出的內容傳遞到主架構中,然後在主架構裡彈出。
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.