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

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

问题描述

我已经设置了Fancybox,当用户点击一个pdf链接时,它会弹出PDF格式,但是在Firefox中会询问您是要保存还是打开文件,我不想这样做。我怎样才能强制PDF显示在fancybox弹出?它在Safari中工作。

 < a class =pdfhref =http://www.test.co。 u.uk/test.pdf\">test.pdf</a> 
$ b $(。pdf)。fancybox({
'width':'700',
'height':'700',
'autoScale' :true,
'transitionIn':'none',
'transitionOut':'none',
'type':'iframe'
});


解决方案

个人而言,我只会使用「Google文件」来显示在iframe中的PDF。它会自动调整PDF大小以匹配iframe的尺寸。这里是使用的格式:

 < iframe src =http://docs.google.com/gview?url = http://samplepdf.com/sample.pdf& embedded = truestyle =width:100%; height:100%; FRAMEBORDER = 0 >< / iframe中> 

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

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

解决方案

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>

You don't need flash or any other plugins.

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

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