1
我試圖在向上滾動的檢測並不順利檢測向上滾動無法正常工作
$(window).bind('DOMMouseScroll scroll mousewheel', function(event) {
if (event.originalEvent.wheelDelta >= 0) {
console.log('scroll up');
}else {
console.log('scroll down');
});
});
這裏使用此代碼來獲得滾動方向問題的結果enter image description here它的屏幕截圖顯示向上滾動然後向下滾動但我沒有向下滾動
我可以使用的窗口,而不是單嗎? – user7412247
絕對,只需更換'div' – Anonymous