Robin's answer didn't quite do the trick for me, for several reasons, so here's a modified and extended version of his approach:
var div = $('.scrollbit');
$('.scrollbit').bind('scroll mousedown wheel DOMMouseScroll mousewheel keyup', function(evt) {
if (evt.type === 'DOMMouseScroll' || evt.type === 'keyup' || evt.type === 'mousewheel') {
}
if (evt.originalEvent.detail < 0 || (evt.originalEvent.wheelDelta && evt.originalEvent.wheelDelta > 0)) {
clearInterval(scrollbit);
}
if (evt.originalEvent.detail > 0 || (evt.originalEvent.wheelDelta && evt.originalEvent.wheelDelta < 0)) {
clearInterval(scrollbit);
}
});
var scrollbit = setInterval(function(){
var pos = div.scrollTop();
if ((div.scrollTop() + div.innerHeight()) >= div[0].scrollHeight) {
clearInterval(scrollbit);
}
div.scrollTop(pos + 1);
}, 100);
with help from anonymous user1248475 here:
Detect whether scroll event was created by user
and this answer:
https://stackoverflow.com/a/9392134
Hope that's helpful for anyone looking to solve the issue of how to auto scroll a div with jquery and stop when user scrolls manually.