我怎样才能知道哪个“按钮”?移动版 Safari 中是否被窃听?

发布于 2024-09-18 18:09:49 字数 328 浏览 2 评论 0原文

我有一个 html“按钮”,实际上就是这样:

<div onClick="window.location.href=somePage.htm">
    <img src="img.png"/>
</div>

在桌面 Safari 中工作正常。它在移动 Safari 中工作...但是,当我在移动 Safari 中点击“按钮”时,我没有看到灰色的小轮廓框准确指示我正在点击的内容。 如何才能显示这个灰色的小轮廓框? 我发现移动版 Safari 的此功能非常有用,我想为用户提供它。

干杯!

I have an html "button" which is really just this:

<div onClick="window.location.href=somePage.htm">
    <img src="img.png"/>
</div>

Works fine in desktop Safari. And it works in mobile Safari... however when I tap the "button" in mobile safari I don't see the little gray outline box indicating exactly what I'm tapping. How can I get this little gray outline box to show up? I find this feature of mobile Safari to be very useful and I'd like to provide it for the user.

Cheers!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心的憧憬 2024-09-25 18:09:49

我认为移动 Safari 仅将此应用于可点击元素。查看此文档。我建议您只需使用 元素来实现此目的:

<a onclick="window.location.href = somePage.htm; return false;">
    <img src="img.png" />
</a>

这应该与您的

完全一样,只是带有一点样式。

I think that mobile Safari applies this to clickable elements only. Have a look at this documentation. I would suggest that you simply use a <a>-element for this purpose:

<a onclick="window.location.href = somePage.htm; return false;">
    <img src="img.png" />
</a>

This should work exactly like your <div> with a little styling.

时间海 2024-09-25 18:09:49

您应该使用链接。

You should use a link.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文