我正在尋找選擇的時候,聽聽鼠標滾輪,以便jquery只刪除一個類並更改其類,然後等待下一個滾動,然後選擇下一個並執行相同操作。但是我的代碼正在全部選擇並且一次更改類。用鼠標滾輪選擇列表元素
function scrollMe(){
$('.header').on('mousewheel', function(e){
e.preventDefault();
var scrolled = e.originalEvent.wheelDelta;
if(scrolled < 0){
$('li').each(function(i){
if($('li').hasClass('no-show')){
$('li').removeClass('no-show').addClass('is-visible');
}
});
}
})
}
謝謝我在這個問題上花了這麼多,所以無法弄清楚解決方案會是那麼簡單謝謝! – mfarhan