If you try this snippet on desktop, everything works.
Whenever you try it on iPad, it won\'t do anything.
i found a solution on http://www.danwellman.co.uk/fixing-jquery-click-events-for-the-ipad/
do the following approach:
var isIPad = function() {
return (/ipad/i).test(navigator.userAgent);
};
var isIPhone = function() {
return (/iphone/i).test(navigator.userAgent);
};
var isIPod = function() {
return (/ipod/i).test(navigator.userAgent);
};
and where you bind the click-event-handler do so:
var eventName = (isIPod() || isIPad() || isIPhone()) ? "touchstart" : "click";
// if you are using jquery-mobile
eventName = (isIPod() || isIPad() || isIPhone()) ? "touchstart" : "vclick";
$(".selector").bind(eventName, function(e) {
//do something here
});
// or
$(document).on(eventName, ".selector", function(e) {
//do something here
});
that's it.