Quick and easy speedup for *most* mobile JavaScript
Listen for touchend instead of click if the device supports click. (Depends on Modernizr.)
var evt = (Modernizr.touch) ? "touchend" : "click";
$("body").on(evt, ".something", function(e){
// do something
});
Written by Jonathan Cutrell
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Jquery
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#