swiper,
fullpage,
일반적인 휠 이벤트 코드
휠 애니메이션 코드
$("휠에 적용될 섹션").each(function(index){
$(this).on('DOMMouseScroll mousewheel', function(e){
var moveTop = null;
if(e.originalEvent.wheelDelta > 0 || e.originalEvent.detail < 0) {
// 120 -3
// 휠을 위로 올렸을 때
if ($(this).prev() != undefined) {
moveTop = $(this).prev().offset().top;
console.log("휠을 위로 올렸음");
}
}
else{
// 휠을 아래로 내렸을 때
if ($(this).next() != undefined) {
moveTop = $(this).next().offset().top;
console.log("다음요 찾기 :"+(index+1));
console.log("휠을 아래로 녀렸음");
}
}
$("html,body").stop().animate({
scrollTop: moveTop + 'px'
},500 );
});
});