iphone / css - 点击时如何防止项目上的黑色半透明覆盖 [英] iphone / css - how do I prevent black semi-transparent overlay on items when clicked

查看:146
本文介绍了iphone / css - 点击时如何防止项目上的黑色半透明覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编程一个移动网站,在iphone上,当您触摸/按住可点击的项目时,图像顶部会显示一个明显的半透明黑色覆盖图。有没有人经历过这个?我该如何摆脱?有没有一种方法与CSS?这是我的代码:

I am programming a mobile site and in iphone there is a noticeable semi-transparent black overlay on top of the image when you touch / hold on an clickable item. Has anyone experienced this? How do I get rid of that? Is there a way with css? This is my code:

childLink = $('<div class="option"/>');
childLink.click(function () {
    $(this).find('.option_image').addClass('active');
    hideScene($(this).attr('data-sceneID'),'standard');
});


推荐答案

您可以设置突出显示的颜色CSS属性 -webkit-tap-highlight-color:

You can set the color of the tap highlighting with the CSS Property -webkit-tap-highlight-color:

禁用突出显示使用alpha = 0的颜色。

To disable highlighting use a color with alpha = 0.

.yourLinkClass {
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

更多信息: http://css-infos.net/property/-webkit-tap-highlight-color

这篇关于iphone / css - 点击时如何防止项目上的黑色半透明覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆