Wyświetlam plik PDF w postaci za pomocą modalnego podręcznego okna jQuery po kliknięciu przycisku. Działa to dobrze we wszystkich przeglądarkach z wyjątkiem IE10, gdzie wyświetlany plik PDF ukrywa okno dialogowe modalne.PDF hide Jquery Modal w IE
Upuszczanie wsparcia dla IE10 nie jest opcją.
Próbowałem użyć z-index. W tym jsfiddle modal jest poza ciałem, ale nic nie działa. Mogłabym ukryć plik PDF na wyskakującym okienku lub zmienić jego położenie, ale mój klient tego nie chce. Próbowałem też var text = prompt("Alert", "textbox's intial text");
- starego javascript, ale klient nie lubi tego wyglądu. Mój TL nie chce używać iframe w trybie modalnym. Czy w ogóle nie mogę wziąć pdf za 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);
Jak mogę zapobiec PDF z pokrycia modalne? (Używam ASP.NET MVCC 5 (C#))
Byłoby lepiej, jeśli edytowany że w pytaniu. – bjb568
@ bjb568, zrobiłem to. – Dhwani
Znacznie lepiej. +1 i wycofane CV. – bjb568