If you listen to scroll events on the node, you can easily use a plugin like scrollTo to smoothly scroll to the "next div" or the previous div (however you define it).
var prevScrollTop = 0;
var $scrollDiv = $('div#content');
var $currentDiv = $scrollDiv.children('div:first-child');
$scrollDiv.scroll(function(eventObj)
{
var curScrollTop = $scrollDiv.scrollTop();
if (prevScrollTop < curScrollTop)
{
// Scrolling down:
$currentDiv = $currentDiv.next().scrollTo();
}
else if (prevScrollTop > curScrollTop)
{
// Scrolling up:
$currentDiv = $currentDiv.prev().scrollTo();
}
prevScrollTop = curScrollTop;
});
I tried different plugins but they all had issues firing multiple events in mvc so I came up with this solution using underscore.js
If you listen to scroll events on the node, you can easily use a plugin like scrollTo to smoothly scroll to the "next div" or the previous div (however you define it).