郎朗坤
2019-07-08 16:18:04
如何在Safari for iPad中使用jQuery識(shí)別觸摸事件?有可能嗎?使用jQuery可以識(shí)別iPad Safari瀏覽器上的觸摸事件嗎?我在Web應(yīng)用程序中使用了mouseover和mouseOut事件。iPad的Safari瀏覽器是否有類似的事件,因?yàn)闆](méi)有像mouseOut、mouseMove這樣的事件?
3 回答

當(dāng)年話下
TA貢獻(xiàn)1890條經(jīng)驗(yàn) 獲得超9個(gè)贊
$('#whatever').on({ 'touchstart' : function(){ /* do something... */ } });

慕神8447489
TA貢獻(xiàn)1780條經(jīng)驗(yàn) 獲得超1個(gè)贊
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貢獻(xiàn)1866條經(jīng)驗(yàn) 獲得超5個(gè)贊
觸地啟動(dòng) 觸移 觸端 觸取消
touchmove
document.addEventListener('touchmove', function(e) { e.preventDefault(); var touch = e.touches[0]; alert(touch.pageX + " - " + touch.pageY);}, false);
添加回答
舉報(bào)
0/150
提交
取消