Can anyone suggest a good simple jQuery vertical autoscroller script? one that's not bloat, I just need for it to auto start and scroll 6 or more li
in a div. i tried the jquery.autoscroll.js but couldn't get it to auto start.
$.fn.autoscroll.defaults = {
start: {
step: 50,
scroll: true,
direction: "down",
pauseOnHover: true
},
delay: 5000,
ffrw: {
speed: "fast",
step: 100
}
};
var div = $('div.autoscrolling');
var scroller = setInterval(function(){
var pos = div.scrollTop();
div.scrollTop(++pos);
}, 100)
Working Demo.
EDIT:
To stop scrolling when the div has scrolled to the bottom add the following check at the end of the above function() {}
-
if($(this).scrollTop() + $(this).innerHeight() >= this.scrollHeight)
clearInterval(scroller);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With