Aim: To get full page front and reverse scroll without using any plugins. What I tried: Please click on this JSFiddle link for my code
Problem I am facing: Front scroll (from top to bottom) is working fine as you can check in the fiddle. But reverse scroll(when we go back to each div from bottom to top) is causing issues. Its hanging between two divs. I have commented out the piece of code in fiddle and Here is the code I tried to get reverse scroll:
if ((scrollPosition < lastScroll) && ($("#"+prevDiv).isOnScreen()) === true) {
console.log("prev div in view");
$('html,body').animate({
scrollTop: $("#"+prevDiv).offset().top
},'slow');
$("#"+prevDiv).addClass("active");
$("#"+currentDiv).removeClass("active");
currentDiv = $("#"+prevDiv);
return false;
}