« Yet another free GeocoderToyota Yaris radio security code unlock instructions »

Disabling highlight on touch in iOS mobile safari web apps

Technical, Android, iPhone, 104 words   English (AU) Bookmark and Share

When building web apps for mobile devices such as mobile Safari on iOS and the web browser on Android devices. When implementing web apps, by default any touch events causes a tint sort of highlight on any anchor elements or DOM elements with click events. On Android particularly HTC sense, it creates a green border.

To disable this, you use the webkit CSS attribute -webkit-tap-highlight-color

This overrides the highlight color shown when the user taps a link or a JavaScript clickable element.

Syntax

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

Note, you’ll need to set the above colour with alpha channel as 0 in order to disable the touch highlight

Trackback address for this post

This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

2 comments

Comment from: Louis [Visitor]
LouisGreat tip! Thanks a lot! :-)
07/08/11 @ 00:58
Comment from: Venkatesh [Visitor]
VenkateshUseful tip. thanks a lot :)
08/02/12 @ 12:20

Leave a comment


Your email address will not be revealed on this site.
(Line breaks become <br />)
(For my next comment on this site)
(Allow users to contact me through a message form -- Your email will not be revealed!)
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)
February 2012
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29        
Brinley Ang

Brinley Ang is a sysadmin, web dev, coder, geek boy, jedi knight fragger, caffine addict, deaf meloncholic and rockstar wannabe. Listens to the sex pistols and a wide assortment of heavy metal.

Make payments with PayPal - it's fast, free and secure!
Search
home | portfolio | blog | links | contact
© 2012 - Brinley Ang
Valid xhtml