使用iframe的Jquery Modal对话框 [英] Jquery Modal dialog with iframe

查看:134
本文介绍了使用iframe的Jquery Modal对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

i需要在Modal jquery窗口中显示aspx页面。
aspx页面中的
,它包含使用PDF.js查看器显示pdf预览的iframe 。

这里我的代码:



Hi friends,
i need to show the aspx page in Modal jquery window.
in aspx page, it contains iframe which display pdf preview by using PDF.js viewer.
here my code:

function opendialog(url) {
            var h = $(window).height();
            var w = $(window).width();

            $('#PreviewCV').load('Admin/PreviewCV.aspx?URL=' + url, function () {
                return true;
            });
            var $dialog = $('#PreviewCV')
              .dialog({
                  autoOpen: false,
                  modal: false,
                  height: h-(h*25/100),
                  width: w-(w*25/100),
                  open: function (type, data) {
                      $(this).parent().appendTo("form");
                  },
                  close: function (type, data) {
                          location.href = $(location).attr('href');
                      }


              });
            $dialog.dialog("open");

        }

        function PDFViewTemplate(item) {
            if (item.GetMember('PDFPath').Value != null && item.GetMember('PDFPath').Value.length >= 3) {
                return "<a onclick='javascript:opendialog(\"viewer.html?file=PDFCV/" + item.GetMember('PDFPath').Value + "\");'><img src='../images/preview_logo.png'></img></a>";
            }

}

below my aspx page(need to display inside dialog window):

<body>
    <form id="form1" runat="server">
    <div>
    <p>Hello</p>
    <iframe id="iframeCV" runat="server" style="border:0"></iframe>
    </div>
    </form>
</body>





我的问题是, iframe不显示在完整模态对话框窗口中。(它在左下角显示为小框)。

我还需要在此aspx页面中添加两个按钮作为选择和拒绝,并使用此pdf预览。



我的代码有什么问题吗?



谢谢,



问候,

lalitha



my problem is, the iframe not display in full modal dialog window.(it display in left corner as small box).
also i need to add two buttons as select and reject in this aspx page with this pdf preview.

is there anything wrong in my code?

Thanks,

Regards,
lalitha

推荐答案

(窗口).height();
var w =
(window).height(); var w =


(window).width();
(window).width();


' #PreviewCV')。load(' Admin / PreviewCV.aspx?URL =' + url,function(){
return true ;
});
var
('#PreviewCV').load('Admin/PreviewCV.aspx?URL=' + url, function () { return true; }); var


这篇关于使用iframe的Jquery Modal对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆