我正在使用jQuery模态弹出窗口,在点击按钮时在
放弃对IE10的支持不是一个选项。
我尝试过使用z-index。在这个 jsfiddle中,模态框位于body之外,但仍然无法解决问题。我可以在弹出窗口时隐藏pdf或更改其位置,但我的客户不希望这样做。我还尝试了旧的javascript代码
<iframe>
中显示PDF。这在除IE10之外的所有浏览器中都可以正常工作,但在IE10中,显示的PDF会隐藏模态对话框。放弃对IE10的支持不是一个选项。
我尝试过使用z-index。在这个 jsfiddle中,模态框位于body之外,但仍然无法解决问题。我可以在弹出窗口时隐藏pdf或更改其位置,但我的客户不希望这样做。我还尝试了旧的javascript代码
var text = prompt("Alert", "textbox's intial text");
,但客户不喜欢那种外观。我的TL不想在模态中使用iframe。难道没有办法将pdf放在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#))