我在按鈕點擊中使用jQuery模式彈出框在中顯示PDF。這在所有瀏覽器中都可以正常工作,除了IE10,其中顯示的PDF隱藏了模式對話框。PDF隱藏IE瀏覽器中的Jquery Modal
丟棄IE10支持不是一種選擇。
我試過使用z-index。在這個jsfiddle中,模態位於體外,但沒有任何效果。我可以在彈出窗口隱藏PDF或更改它的位置,但我的客戶不希望這樣。此外,我嘗試var text = prompt("Alert", "textbox's intial text");
- 舊的JavaScript,但客戶端不喜歡那樣的外觀。 我的TL不想在模態中使用iframe。反正我不能把HTML放在HTML之後?
HTML:
<body>
<div id='ClickMe'>Click here!</div>
<br/>
<div>This is more than likely an Adobe issue where it thinks it should be in front all the time no matter what, however it is very annoying that you can't open a dialog over a PDF. Click on the 'Click here!' text above to see this issue occur. Interesting enough if you click the Discuss button in JSFiddle it does the same thing.</div>
<br/>
<iframe src="http://www.ccc.commnet.edu/faculty/sfreeman/cst%20250/jQueryNotes.pdf" style="width:100%; height:700px;" frameborder="1"></iframe>
</body>
的jQuery:
var $Dialog_div;
function fnOpenDialog() {
var str = '<div id="dialog" style="display: none;height:60%;" title="On Hold Reason" align="center">'+'<br />'+'<textarea id="messageTextBox" cols="32" rows="3" style="resize:none"></textarea>'+'<div class="row" align="center">'+'<br />'+'</div>'+'<br />'+'</div>';
$Dialog_div = $(str).prependTo('body');
// $Dialog_div = $('<div id=\'ThisDialog\'>Hello</div>').prependTo('body');
$Dialog_div = $('#dialog').dialog({
autoOpen: true,
draggable: true,
resizable: true,
title: 'Dialog',
modal: true,
stack: true,
height: ($(window).height() * 0.95),
width: ($(window).width() * 0.9),
buttons: {
'Yes': function() {
alert($('#messageTextBox').val());
$Dialog_div.dialog('close');
},
'No': function(){
alert('No');
$Dialog_div.dialog('close');
}
}
});
}
$('#ClickMe').click(fnOpenDialog);
我如何防止覆蓋模式的PDF? (我使用ASP.NET MVCC 5(C#))
這將是更好,如果你編輯了進入正題。 – bjb568
@ bjb568,做到了。 – Dhwani
好得多。 +1並收回簡歷。 – bjb568