我使用twitter引導程序在我的應用程序中創建了一個模式。在onclick事件中創建模式 它在firefox和chrome中工作正常。但在ie8中運行我的應用程序時,該模式內部的NewPage.aspx頁面未正確查看。使用Modals時發出的問題
這裏是我的代碼:
<div id="MyModal" class="modal hide in">
<div class="modal-dialog">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×</button>
<h3 id="myModalLabel">
Header</h3>
</div>
<div class="modal-content">
<div class="modal-body">
<iframe id="modal-frame" src="" style="zoom: 0.60; position: relative;" frameborder="0"
height="450" width="850"></iframe>
</div>
</div>
</div>
</div>
<button modalurl="~/NewPage.aspx" id="lnkNewModal" onclick="openMyModal(this);"
runat="server">Modal</Button>
function openMyModal(curObj) {
$("#MyModal").modal({
"backdrop": "static",
"keyboard": true,
"show": true
});
var url = $(curObj).data("modalurl");
$('#MyModal').on('show', function() {
$('#modal-frame').attr("src", url);
});
$('#MyModal').modal({ show: true });
}
謝謝大家提前對您的回覆。
有問題,你的模態或頁面內的iframe ..?這段代碼如何幫助我們幫助你? – reyaner
問題出在iframe中的頁面。 IE頁面在iframe中顯示不正確。 – Deepak