首页 > 解决方案 > 如果我在 iframe 外部单击,一键登录隐藏

问题描述

我已经在我的网站中集成了Google On Tap Login 。我想要的是,在我单击 I 框架标题上的X图标之前,iframe 不应关闭,但默认情况下,如果用户单击页面上的任何位置,它就会关闭。

如果用户在 iframe 之外单击,我想禁用 iframe 的关闭。

从文档[Toggle outside tap to close One Tap ] 中,您可以在将data-cancel_on_tap_outside属性设置为 时禁用此行为false。不幸的是,这不起作用。

任何帮助将不胜感激。

<div
    id="g_id_onload"
    data-client_id=xxxxxxxxxxxxxx.apps.googleusercontent.com"
    data-cancel_on_tap_outside=true
    >
</div>

标签: google-oauthgoogle-api-client

解决方案


我的错误,清除浏览器缓存后,一切正常。


推荐阅读