Reputation: 23533
What's the simplest way to detect a click event with jquery for touchscreens only? I know that modenizr could be used to achieve this but as I only need this basic functionality I was wondering if it could be done with jquery only.
Upvotes: 1
Views: 932
Reputation: 23533
jQuery onMouseover/onClick for Touchscreen users (ie iPad)
if ("ontouchstart" in window || "ontouch" in window) {
// put click listener here
}
Seems to work fine.
Upvotes: 2