2012-03-31 72 views
1

我的網站www.philipmadeley.com在導航中的「觸摸」事件中遇到問題。它似乎處理的第一個「觸摸」好,但後來不工作的休息。我厭倦了幾個解決方案,但我不是那種技術,所以我想我可能忽略了一些東西......無論如何,我似乎無法找到答案。希望你能幫助。重置觸摸事件的事件處理程序

回答

0

使用event.originalEvent.touches或event.orignialEvent.changedTouches

,並使用實例0

$("#div").bind("touchstart",function(event){ 

    event.preventDefault();    
    var touches = event.originalEvent.touches || event.originalEvent.changedTouches; 
    if(touches.length == 1){ 

var touch = touches[0]; 

// Place element where the finger is horizontally 
tx = touch.pageX ; 

警報(TX); }});

+0

非常感謝:) – 2014-12-06 07:48:10

+0

@cheers_to_you您會接受答案嗎?謝謝 – Bakly 2014-12-07 08:13:44

+0

當然,這聽起來不錯,謝謝。 – 2014-12-07 10:04:42