How to disable the effect of the orange circle when you click on the link in WebView

I'm trying to catch the location of the mouse click, so I wrote onClick in the body tag, but every time I click on the page, the whole page turns orange for a while. Is it possible to disable this setting?

+6
javascript android webview
source share
3 answers

According to this thread, you can override the default orange outline by overriding

-webkit-tap-highlight-color

from

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

in your css file (you need to create a css file and add it if you don't have one). The last value of 0 sets the alpha value to effectively make the color invisible (1 fully visible). If this is not the exact css style you are looking for, you can refer to other webkit styles to find similar ads.

Supports Joe McCann for the idea.

+15
source share

McStretch's answer is correct. Webkit on Android compiled with this property set to orange, with css you can override this.

Paste the following into your css:

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

(sorry, don't know how to add this as a comment on this answer)

+4
source share

Mouseclick () function {var locString = "X =" + window.event.screenX + "Y =" + window.event.screenY; alerts (locString); }

this function can be used to locate mouseclick

-2
source share

All Articles