Instantly share code, notes, and snippets.

Embed
What would you like to do?
Handle 'click' events in jQuery with support for the default browser shipped with Android Gingerbread (2.3)
var touch = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;
var touchEvent = touch ? 'touchstart' : 'click';
$('#anItem').bind(touchEvent, function() {
console.log("Touchclicked:", this);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment