I have an ion scroll that scrolls accourding other component. To do that i use the function scroll1.scrollTo(left, top, false);
However, this function doesn't allow to scroll to a negative position like
scroll1.scrollTo(left, -50, false);
So is it possible to achieve this ?
My scroll must do scrolling without any user interaction (this is why i use the scrollTo function), and my main goal with the negative top position is to simulate a bouncing effect.
This is clearly possible with VelocityJS Velocity is a very powerfull FULL Javascript animation / scroll and much more librairy.
Demo of velocity Scroll : demo scroll velocity
$element
/* Then scroll to a position 250 pixels BELOW the div. */
.velocity("scroll", { duration: 750, offset: 250 })
/* Scroll to a position 50 pixels ABOVE the div. */
.velocity("scroll", { duration: 750, offset: -50 });