对于触摸设备,我需要相同的代码。请帮帮我
$(window).on('DOMMouseScroll mousewheel', function (e) {
if (ScrollEnable) {
if (e.originalEvent.detail > 0 || e.originalEvent.wheelDelta < 0) {
console.log('Down');
} else {
console.log('Up');
}
}
return false;
});
这是我的触摸代码,但是领事刚刚开始我需要找到我的网站!我能做什么:|
$('body').on({
'touchmove': function(e) {
if (e.originalEvent.touches > 0 || e.originalEvent.touches > 0) {
console.log('Down');
} else {
console.log('Up');
}
}
});
原文由 Morteza Negahi 发布,翻译遵循 CC BY-SA 4.0 许可协议
您可以使用滚动事件