Jquery scrollto duration problem
I'm trying to add scrolling buttons that scroll the page onmousover. They work great, however, since the duration is a fixed value, and the distance changes based on how far the user scrolls, it sometimes scrolls fine (when the distance and duration are proportioned), and very slow (when the duration is way higher than the distance)...
Is there any way to change the duration based on the distance? To make some sort of "speed" setting, instead of a constant duration?
Here is the code
-
$('#right_button').mouseover(function(){
$('#print').scrollTo('100%', {
axis:'x',
target:'#print',
duration: 5000});
}).mouseout(function(){
$('#print').stop();
});
it just scrolls a div that has overflown content.