Jquery's $ (document) .click () on the issue of the failure iphone mobile phone

click event and touchstart events coexist Android phones IOS applicable

$(document).on("click touchstart", ".demo", function() { alert("demo"); });

Such as: touchstart this event does not work well 

To the class as a demo of the div add a css: cursor: pointer;

Guess you like

Origin www.cnblogs.com/hanguidong/p/11527894.html