如何在模态窗口中显示PDF?(How to display a pdf in a modal window? [closed])

编程入门 行业动态 更新时间:2024-10-25 00:32:40
如何在模态窗口中显示PDF?(How to display a pdf in a modal window? [closed])

我有一个模态窗口,其中包含一个锚文本。 当我点击这个链接时,它必须调用其他地方的pdf并将其显示在弹出窗口中。 我怎样才能做到这一点 ?

请帮助。

I have a modal window, which contains an anchor text. When i click on this link, it must call a pdf housed somewhere else and display it in a pop up . How can I do that ?

Kindly help .

最满意答案

您可以使用jQuery UI对话框执行此操作,您可以从此处下载 JQuery ui 下载JQueryUI

首先在<head>标签中包含这些脚本

<link href="css/smoothness/jquery-ui-1.9.0.custom.css" rel="stylesheet"> <script language="javascript" type="text/javascript" src="jquery-1.8.2.js"></script> <script src="js/jquery-ui-1.9.0.custom.js"></script>

JQuery代码

<script language="javascript" type="text/javascript"> $(document).ready(function() { $('#trigger').click(function(){ $("#dialog").dialog(); }); }); </script>

<body>标签内的HTML代码。 使用iframe加载内部的pdf文件

<a href="#" id="trigger">this link</a> <div id="dialog" style="display:none"> <div> <iframe src="yourpdffile.pdf"></iframe> </div> </div>

You can do this using with jQuery UI dialog, you can download JQuery ui from here Download JQueryUI

Include these scripts first inside <head> tag

<link href="css/smoothness/jquery-ui-1.9.0.custom.css" rel="stylesheet"> <script language="javascript" type="text/javascript" src="jquery-1.8.2.js"></script> <script src="js/jquery-ui-1.9.0.custom.js"></script>

JQuery code

<script language="javascript" type="text/javascript"> $(document).ready(function() { $('#trigger').click(function(){ $("#dialog").dialog(); }); }); </script>

HTML code within <body> tag. Use an iframe to load the pdf file inside

<a href="#" id="trigger">this link</a> <div id="dialog" style="display:none"> <div> <iframe src="yourpdffile.pdf"></iframe> </div> </div>

更多推荐

本文发布于:2023-04-29 08:28:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1335887.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模态   窗口中   如何在   PDF   display

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!