2012-03-31 69 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