Enable :active state on iOS
The :active pseudo-selector doesn't work by default on iOS. Fortunately there is a simple fix - simply bind an eventHandler to the touchstart
event on any elements that need to use the :active
state.
$(window).on('load', function() {
if(/iP(hone|ad)/.test(window.navigator.userAgent)) {
$('.things-that-need-active').on('touchstart', function() {});
}
});
More details over at http://blog.29ways.co.uk/tips-for-consistent-mobile-behaviour/
Written by Adam Phillips
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Responsive
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#