如何在模态窗口中显示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>更多推荐
发布评论