html - UIWebView 中讨厌的事件点击可视化

标签 html ios css

我在 iPhone 应用程序中有一个 UIWebView。在 html 代码中有一个名为 loadedBar 的大图像,它具有绑定(bind)到它的效果,使用 jQuery,方法如下:

$('#loadedBar').click(function(){ ... });

函数里的一切都OK,但是有一个我不需要的可视化效果。单击图像时,它会在几分之一秒内变为灰色。我在带有事件的 div 上发现了相同的行为,绑定(bind)方式与图像相同。

这是默认的 UIWebView event-click-visualisation 吗?有没有办法将其关闭(某些 CSS 规则可能会起作用),以便应用程序的行为像 native 应用程序一样。

有什么想法吗?

最佳答案

您正在寻找:

-webkit-tap-highlight-color:<css-color>

This is an inherited property that changes the tap highlight color, obeying the alpha value. If you don’t specify an alpha value, Safari on iOS applies a default alpha value to the color. To disable tap highlighting, set the alpha to 0 (invisible). If you set the alpha to 1.0 (opaque), then the element won’t be visible when tapped.

文档:http://developer.apple.com/library/ios/#documentation/AppleApplications/Reference/SafariWebContent/AdjustingtheTextSize/AdjustingtheTextSize.html

禁用属性的示例:

-webkit-tap-highlight-color:rgba(0,0,0,0);

关于html - UIWebView 中讨厌的事件点击可视化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12941910/

相关文章:

html - 浏览器的 100% 高度

HTML/CSS 'rgba' CSS 属性不起作用内部 div 的不透明度没有完全不透明

javascript - jQuery Toggle 第二次无法正常工作

ios - 苹果 5 4 英寸

css - 输入后显示图标

css - 将 div 宽度自然扩展到另一端的问题

javascript - 提交按钮是否必须包含在表单中

ios - 向下滚动表格 View 时如何使自定义标签作为 NavBar 消失?

ios - iOS 11 中带有大标题导航栏的自定义背景图片

html - 如何使用 css 将 Accordion 列表拆分为两列并使用react?