본문 바로가기
jquery

fullPage.js 에서 특정 인덱스일 때, 인덱스 이동할 때 이벤트 만들기

by 바나냥 2020. 4. 4.
$(function() {
	$.fn.fullpage({
    		// 특정 인덱스일 때
		'afterLoad': function (anchorLink, index) {
			if (index == 1){
				alert ('첫번째 인덱스');
			}
		},	

		// 페이지 이동할 때
		'onLeave' : function (index, nextIndex, direction){
			if (index == 3 && direction == 'down'){
				alert ('3번에서 4번으로');
			} else if (index == 3 && direction == 'up'){
				alert ('3번에서 2번으로');
			}
		}
	});
});

댓글