Firefox 中的 Fancybox PDF 问题 [英] Fancybox PDF issue in Firefox

查看:33
本文介绍了Firefox 中的 Fancybox PDF 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了 Fancybox,这样当用户单击 pdf 链接时,它会在弹出窗口中显示 pdf,但是在 Firefox 中它会询问您是要保存还是打开文件,而我不想要这个.如何强制 pdf 在 fancybox 弹出窗口中显示?它适用于 Safari.

I have Fancybox set up so that when a user clicks on a pdf link it displays the pdf in a pop up, however in Firefox it asks if you want to save or open the file and I don't want this. How can I force the pdf to be display in the fancybox popup? It works in Safari.

<a class="pdf" href="http://www.test.co.u.uk/test.pdf">test.pdf</a>

$(".pdf").fancybox({
   'width' : '700',
   'height' : '700',
   'autoScale' : true,
   'transitionIn' : 'none',
   'transitionOut' : 'none',
   'type' : 'iframe'
});

推荐答案

就个人而言,我只会使用 Google Docs 在 iframe 中显示 PDF.它会自动调整 PDF 的大小以匹配 iframe 尺寸.这是要使用的格式:

Personally, I would just use Google Docs to display the PDF in an iframe. It automatically resizes the PDF to match the iframe dimensions. Here is the format to use:

<iframe src="http://docs.google.com/gview?url=http://samplepdf.com/sample.pdf&embedded=true" style="width:100%; height:100%;" frameborder="0"></iframe>

您不需要 flash 或任何其他插件.

You don't need flash or any other plugins.

这篇关于Firefox 中的 Fancybox PDF 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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