很可能,您没有在 Firefox 中安装 pdf 插件,或者该插件刚刚崩溃。
在 Firefox 中,转到 Tools --> Add-ons -->Plugins 并在列表中查找 Adobe Acrobat PDF 插件。如果没有,请check this 了解如何安装(或重新安装)。
此外,除了 iframe 之外,还有一种更好的方法可以用 fancybox 打开 PDF 文件,所以对于这个 html:
<a class="pdf" href="http://www.test.co.u.uk/test.pdf">test.pdf</a>
你可以使用这个脚本:
$(document).ready(function() {
$(".pdf").click(function() {
$.fancybox({
'width': '70%', // or whatever
'height': '90%',
'autoDimensions': false,
'content': '<embed src="'+this.href+'#nameddest=self&page=1&view=FitH,0&zoom=80,0,0" type="application/pdf" height="99%" width="100%" />',
'onClosed': function() {
$("#fancybox-inner").empty();
}
});
return false;
}); // pdf
}); // ready
自从May 2010 起,我就向 Fancybox v1.3.x 推荐了这种方法
请注意我设置了 height="99%"。如果您使用 HTML5 DCTYPE,它将避免双垂直滚动条。这是因为 HTML5 会初始化边距。
更新。
顺便说一句,整数值没有 qoutes 所以
'width' : '700',
'height' : '700',
应该是
'width' : 700,
'height' : 700,
它会为您省去一些麻烦,主要是使用 IE