【发布时间】:2010-12-15 10:24:59
【问题描述】:
我用 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);
});
【问题讨论】:
-
要获得代码修复的答案 - 发布一个演示并在问题中链接到它,以便人们可以测试什么工作以及如何工作。
标签: jquery jquery-mobile