如何使用谷歌驱动器嵌入的iframe禁用pdf查看器中的弹出选项

问题描述 投票:0回答:2

我使用iframe google drive pdf viewer在我的网站上嵌入了pdf,下面是我用过的代码

它工作正常,但我想删除我的网站右上角出现的弹出按钮,以便观众无法在我的页面外查看] 1

任何帮助,将不胜感激

javascript html css pdf
2个回答
0
投票

尝试类似下面的内容:在弹出按钮顶部使用隐藏元素使其无法访问。或者,如果要隐藏,请删除不透明度并设置背景颜色。

<div style="width: 640px; height: 480px; position: relative;"> 
      <iframe src="http://docs.google.com/viewer?url=YOUR PDF/DOC FILE URL &embedded=true"   width="640" height="480" frameborder="0" scrolling="no" seamless=""></iframe>
      <div style="width: 40px; height: 40px; position: absolute; opacity: 0; right: 12px; top: 12px;">&nbsp;</div>
 </div>

0
投票

使用此代码

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style type="text/css">
        iframe{
  height:100vh;
}
    </style>

</head>
<body>



<iframe src="https://docs.google.com/viewer?url=http://www.pdf995.com/samples/pdf.pdf&embedded=true" width="100%" height="100vh" frameborder="0" scrolling="no" ></iframe>

<div style="width: 80px; height: 80px; position: absolute; opacity: 0; right: 0px; top: 0px;">&nbsp;</div>
<!-- </div> -->
</body>

</html>

© www.soinside.com 2019 - 2024. All rights reserved.