2012-05-24 2 views
0

내 사이트에서 플레이어를 사용하려고 시도하고 있습니다 (코드를 사용하지 않았습니다.). 어쨌든, 플레이어는 ipad를 사용하여 시도하고 반응 할 때 응답하지 않는 터치 이벤트가 내장되어 있습니다. 볼륨 슬라이더는 왼쪽과 오른쪽으로 드래그 할 수 있어야하며 음악 스트림은 동일한 일을 할 수 있어야하지만 현재는 작동하지 않습니다.터치 이벤트에 문제가 있습니다.

// seeking in the loaded track buffer 
    $('.sc-time-span') 
    .live('click', function(event) { 
     scrub(this, event.pageX); 
     return false; 
    }) 
    .live('touchstart', function(event) { 
     this.addEventListener('touchmove', onTouchMove, false); 
     event.originalEvent.preventDefault(); 
    }) 
    .live('touchend', function(event) { 
     this.removeEventListener('touchmove', onTouchMove, false); 
     event.originalEvent.preventDefault(); 
    }); 

    // changing volume in the player 
    var startVolumeTracking = function(node, startEvent) { 
    var $node = $(node), 
     originX = $node.offset().left, 
     originWidth = $node.width(), 
     getVolume = function(x) { 
      return Math.floor(((x - originX)/originWidth)*100); 
     }, 
     update = function(event) { 
      $doc.trigger({type: 'scPlayer:onVolumeChange', volume: getVolume(event.pageX)}); 
     }; 
    $node.bind('mousemove.sc-player', update); 
    update(startEvent); 
    }; 

    var stopVolumeTracking = function(node, event) { 
    $(node).unbind('mousemove.sc-player'); 
    }; 

    $('.sc-volume-slider') 
    .live('mousedown', function(event) { 
     startVolumeTracking(this, event); 
    }) 
    .live('mouseup', function(event) { 
     stopVolumeTracking(this, event); 
    }); 

    $doc.bind('scPlayer:onVolumeChange', function(event) { 
    $('span.sc-volume-status').css({width: event.volume + '%'}); 
    }); 

답변

0

내가 추측하고 당신이 사용하고 있기 때문에 jQuery의 라이브() 바인딩,하지만 작동 플러그인 jQuery를 UI 터치 이벤트에 의존 할 수있다. http://touchpunch.furf.com/에서 플러그인을 포함하면 문제가 해결 될 것입니다.

관련 문제