Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 单击时删除html图像上的蓝色突出显示_Jquery_Html - Fatal编程技术网

Jquery 单击时删除html图像上的蓝色突出显示

Jquery 单击时删除html图像上的蓝色突出显示,jquery,html,Jquery,Html,我正在用Android制作一个定制应用程序。我正在显示一个在div中带有img标记的html页面 <div class="press"> <img src="but.png" width="150" height="62" border="0"/> </div> 当我单击图像时,单击正在工作,但图像被蓝色覆盖层包围 我不知道怎么把它取下来。我试过很多方法,但没有一个有效的答案。请帮忙。谢谢您可以通过css阻止页面上的选择。可以将*选择器更改为要阻

我正在用Android制作一个定制应用程序。我正在显示一个在div中带有img标记的html页面

<div class="press">
    <img src="but.png" width="150" height="62" border="0"/>
</div>
当我单击图像时,单击正在工作,但图像被蓝色覆盖层包围


我不知道怎么把它取下来。我试过很多方法,但没有一个有效的答案。请帮忙。谢谢

您可以通过css阻止页面上的选择。可以将*选择器更改为要阻止选择的元素选择器

/*IE9*/
*::selection 
{
    background-color:transparent;
} 
*::-moz-selection
{
    background-color:transparent;
}
*
{        
    -webkit-user-select: none;
    -moz-user-select: -moz-none;
    /*IE10*/
    -ms-user-select: none;
    user-select: none;

    /*You just need this if you are only concerned with android and not desktop browsers.*/
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}    
input[type="text"], textarea, [contenteditable]
{

    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

它可以是包含按钮的div上的背景色或边框色。其他的 使用如下代码在完全单击后删除css

$("#myButton").click(function(){
   $("#displayPanel div").removeClass('someClass');
});
试试这个:

CSS

.press, img, .press:focus, img:focus{
    outline: 0 !important;
    border:0 none !important;
}
您可以使用CSS:

**HTML**

<button class="press">
    <img src="but.png" width="150" height="62" border="0"/>
</button>

答案如下:

可能与hey ryan的副本相同。。。那篇文章中的解决方案对我不起作用…现在试试上面我所做的更改。我仍然得到相同的错误Rohan。事实上,我正在使用android平台和一个增强现实应用程序,该应用程序在摄像头顶部显示一个浏览器。hi rohan感谢您的支持,但错误仍然存在,我在图像周围获得了一个新的黑色背景。您能为它创建一个JSFIDLE吗?
-webkit点击高亮颜色
正是我想要的!谢谢!!
<button class="press">
    <img src="but.png" width="150" height="62" border="0"/>
</button>
.press{
    outline-width: 0;
}

.press:focus{
    outline: none;
}