如何在Safari for iPad中使用jQuery识别触摸事件?有可能吗?使用jQuery可以识别iPad Safari浏览器上的触摸事件吗?我在Web应用程序中使用了mouseover和mouseOut事件。iPad的Safari浏览器是否有类似的事件,因为没有像mouseOut、mouseMove这样的事件?
3 回答

当年话下
TA贡献1890条经验 获得超9个赞
$('#whatever').on({ 'touchstart' : function(){ /* do something... */ } });

慕神8447489
TA贡献1780条经验 获得超1个赞
canvas .hammer({prevent_default: true}) .bind('doubletap', function(e) { // And double click // Zoom-in }) .bind('dragstart', function(e) { // And mousedown // Get ready to drag }) .bind('drag', function(e) { // And mousemove when mousedown // Pan the image }) .bind('dragend', function(e) { // And mouseup // Finish the drag });

心有法竹
TA贡献1866条经验 获得超5个赞
触地启动 触移 触端 触取消
touchmove
document.addEventListener('touchmove', function(e) { e.preventDefault(); var touch = e.touches[0]; alert(touch.pageX + " - " + touch.pageY);}, false);
添加回答
举报
0/150
提交
取消