C# PDF隐藏IE中的Jquery模式

C# PDF隐藏IE中的Jquery模式,c#,javascript,jquery,html,internet-explorer,C#,Javascript,Jquery,Html,Internet Explorer,单击按钮时,我使用jQuery模式弹出窗口在中显示PDF。这在除IE10之外的所有浏览器中都可以正常工作,在IE10中显示的PDF隐藏了模式对话框 放弃IE10支持不是一个选项 我试着使用z-index。在这种情况下,模态在主体之外,但没有任何效果。我可以在弹出窗口中隐藏pdf或更改其位置,但我的客户不希望这样。我还尝试了var text=prompt(“警报”,“文本框的初始文本”)-旧javascript,但客户端不喜欢这种外观我的TL不想在模式中使用iframe。我不是可以在HTML后面使

单击按钮时,我使用jQuery模式弹出窗口在
中显示PDF。这在除IE10之外的所有浏览器中都可以正常工作,在IE10中显示的PDF隐藏了模式对话框

放弃IE10支持不是一个选项

我试着使用z-index。在这种情况下,模态在主体之外,但没有任何效果。我可以在弹出窗口中隐藏pdf或更改其位置,但我的客户不希望这样。我还尝试了
var text=prompt(“警报”,“文本框的初始文本”)-旧javascript,但客户端不喜欢这种外观我的TL不想在模式中使用iframe。我不是可以在HTML后面使用pdf吗

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>
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);

点击这里!

这很可能是Adobe的一个问题,它认为无论发生什么事情,它都应该一直在前面,然而,你不能在PDF上打开一个对话框,这是非常恼人的。单击“单击此处!”请参阅上面的文本以查看此问题的发生。有趣的是,如果单击JSFIDLE中的“讨论”按钮,它也会做同样的事情。
jQuery:

<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>
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);
var$Dialog\u div;
函数fnOpenDialog(){
var str='+'
'+'+'+'
'+'+'+'
'+'
'+''; $Dialog_div=$(str).prependTo('body'); //$Dialog_div=$('Hello')。prependTo('body'); $Dialog_div=$('#Dialog')。Dialog({ 自动打开:对, 真的, 可调整大小:正确, 标题:“对话”, 莫代尔:是的, 斯塔克:没错, 高度:($(窗口).height()*0.95), 宽度:($(窗口).width()*0.9), 按钮:{ “是”:函数(){ 警报($('#messageTextBox').val()); $Dialog_div.Dialog('close'); }, “否”:函数(){ 警告(“否”); $Dialog_div.Dialog('close'); } } }); } $('#ClickMe')。单击(fOpenDialog);


我如何防止PDF覆盖模态?(我正在使用ASP.NET MVCC 5(C#))

找到了这个可能有用的答案


您的web浏览器似乎不支持iFrame

pdf.html代码

<body>
    <object data="lorem.pdf" type="application/pdf">
        <p>It appears you don't have Adobe Reader or PDF support in this web browser. <a href="lorem.pdf">Click here to download the PDF</a>. Or <a href="http://get.adobe.com/reader/" target="_blank">click here to install Adobe Reader</a>.</p>
       <embed src="lorem.pdf" type="application/pdf" />
    </object>
</body>

此web浏览器中似乎没有Adobe Reader或PDF支持。或者


我创建了一个支持IE10及以下版本的解决方案。您可以查看


解决方案检测浏览器是否为IEAdd down Line Inside对话框将解决您的问题


我遇到了同样的问题,并想出了一个简单的解决方案。它可能不适用于所有情况,但在我的情况下,在打开模式时简单地隐藏PDF是可以接受的。我用了如下的方法:

$('.modal').on('show.bs.modal', function () {
    // IE pdf embed plugin sits above modals
    if (isIE()) {
        $('body').addClass('hide-iframes');
    }
}).on('hidden.bs.modal', function () {
    if (isIE()) {
        $('body').removeClass('hide-iframes');
    }
});


如果你把它编辑成问题会更好。好多了+1和收回的CV。当对话框打开时隐藏iframe如何?然后把它放回到关闭对话框上。@ICanHasKittenz好吧,我问过客户这个选项,但他想把它放在后面。所以不能隐藏。@Dhwani我已经做了一些调整,它肯定在工作。看看新的和新的。上面也有新的截图。如果您对此版本有任何问题,请提供一个屏幕截图,谢谢。让我们@Dhwani来澄清问题。解决方案使用
显示模式对话框;这是IE10及以下版本允许在插件(如PDF)上添加一层的唯一方法。您的描述说我的TL不想在模式中使用iframe,pdf iframe不在模式中,它在后面。我想在这方面提供帮助,但我需要了解我的最新解决方案仍存在哪些问题。嘿,我在safari中也面临同样的问题。这是我的问题。你知道有什么问题吗?我也有同样的解决方案,但我的客户希望在后端保持pdf打开。所以我跳过这个想法。顺便说一句,谢谢