javascript - 如何限制突出显示 iframe
问题描述
我有一个嵌入式手机游戏,它被包裹在一个 iframe 中,游戏需要用户按住手指才能让玩家飞起来。
<iframe style= "position:relative;top:0;left:0;width:100%;height:100%;border:0;" src="https://play.gamepix.com/badland/embed" allowFullScreen></iframe>
游戏运行良好,但是当您按住手指时,整个屏幕会以透明的蓝色突出显示,并且“复制/分享”图标会在游戏中间弹出。我试过添加:
-webkit-user-select: none;
-webkit-touch-callout: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
……但它不起作用。
有没有办法限制突出显示/选择 iframe?
解决方案
你试过frameborder=0
吗?
<iframe frameborder="0" style="background:none transparent;position:relative;top:0;left:0;width:100%;height:100%;border:0;" src="https://play.gamepix.com/badland/embed" allowFullScreen>
</iframe>
如果你不是在寻找它,请提供一些屏幕截图以便更好地理解。
推荐阅读
- xml - 如何说服 groovy.xml.MarkupBuilder 创建名称为“use”的节点
- c - 合并 2 个快速排序的数组会导致全 0
- regex - 在 Angular 7 中难以找到正确的正则表达式模式
- reactjs - 什么是正确的反应应用程序文件结构?
- c++ - 尝试在 C++ 中返回字符串数组时遇到错误
- python - 如何使用模板标签调用 django-taggit 标签
- django - 我的 django 应用程序中的默认数据库是只读的
- amazon-web-services - AWS .Net Core 无服务器应用程序 - “配置文件”信息存储在哪里?
- java - 按下按钮时导航抽屉错误
- java - 我将如何调用以从单独的包中运行另一个类?