Return to Snippet

Revision: 76898
at August 1, 2019 17:09 by cerxx


Initial Code
var UA = navigator.userAgent,
iOS = !!(UA.match(/iPad|iPhone|Android/i));
$(this).on("click", function(){
	// do somthing
});
if (iOS) {
	$(document).on('touchstart', function (e) {
		e.target.click();
	});
}

Initial URL
https://stackoverflow.com/questions/10577906/how-to-make-my-click-function-work-with-ios#answer-41984774

Initial Description
Here is a code that force to fire a click on iOS devices, where there is first a touchstart event

Initial Title
Click on iOs and Android

Initial Tags
jquery

Initial Language
JavaScript