【问题标题】:How to restrict highlighting an iframe如何限制突出显示 iframe
【发布时间】:2021-07-22 16:05:04
【问题描述】:

我有一个嵌入在 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?

【问题讨论】:

    标签: javascript html css iframe


    【解决方案1】:

    你试过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>
    

    如果你不是在寻找它,请提供一些屏幕截图以便更好地理解。

    【讨论】:

    • 感谢您的回答。不幸的是,它没有用。我添加了一个屏幕截图。
    猜你喜欢
    • 1970-01-01
    • 2020-08-13
    • 2016-03-12
    • 2012-02-24
    • 1970-01-01
    • 1970-01-01
    • 2013-09-24
    • 1970-01-01
    • 2018-12-03
    相关资源
    最近更新 更多