我用jquery写了一个小的滚动条。这个滚动条在PC和Mac上运行得很完美。然而,在触摸设备上无法正常工作。
我猜想这是由于调用mousedown属性所致。如何让它在PC和触摸屏设备上都能正常工作呢?
谢谢。
$('.scroll-nav-up, .scroll-nav-down').live('click', function(){
$('.scroller-wrap').stop();
return false;
});
$('.scroll-nav-up').live('mousedown', function(){
$(this).closest('.item').find('.scroller-wrap').animate({
top: -($(this).closest('.item').find('.scroller-wrap').height() - 250)
}, 800);
});
$('.scroll-nav-down').live('mousedown', function(){
$(this).closest('.item').find('.scroller-wrap').animate({
top: 0
}, 800);
});