如何使用google doc iframe禁用pdf查看器中的弹出选项? [英] How to disable pop-out option in pdf viewer with google doc iframe?

查看:906
本文介绍了如何使用google doc iframe禁用pdf查看器中的弹出选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下代码使用谷歌与iframe显示pdf ..它工作正常。
但我想在我的网页上的zoomin选项旁边的右上角显示弹出选项(在点击打开我的pdf在新标签页面中显示谷歌文档)。有可能吗?

I am using following code to display pdf using google with iframe.. It's working fine. But I want to disable "pop-out" option (which on click opening my pdf in new tab with google docs) shown on right upper corner beside zoomin option on my webpage. Is it possible?

目前我正在使用以下代码 -

Currently I am using following code -

<iframe src="http://docs.google.com/gview?url=http://example.com/files/myfile.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0">

推荐答案

以下解决方案对于删除预览按钮非常有用。添加iframe的此代码onload函数。它是在iframe加载后应用的。

The following solution is useful to remove preview button. Add this code onload function of your iframe. It's applied after iframe is loaded.

var head = $("#iframe").contents().find("head");
var css = '<style type="text/css">' +
          '.ndfHFb-c4YZDc-Wrql6b{display:none}; ' +
          '</style>';
$(head).append(css);

这篇关于如何使用google doc iframe禁用pdf查看器中的弹出选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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