Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slimscroll scrollbar not moving when content scrolled by scrollBy or scrollTo

I have a slimscroll applied content. I scroll to a content by using scrollTo and scrollBy parameters. Ex:

$element.slimScroll({scrollBy : '100px'});

It works and content is scrolled by given amount. However, scrollbar does not move and stays at top position and when I try to scroll the content by mouse wheel it will start to scroll from the top position, not from where I scrolled to by javascript. So, at first mouse wheel scroll, I see the content at the top, not the content below where I scrolled with javascript.

How can I solve this?

like image 446
zarax Avatar asked Oct 30 '22 22:10

zarax


1 Answers

Revert to slimscroll version 1.3.1. A change in later versions cause this problem.

Btw, slimscroll mouse wheel scroll not workink properly on mozilla firefox. It either goes to the top or bottom, you cannot scroll it properly. To solve that problem:

Find the following line in the slimscroll file and remove or comment out:

this.addEventListener('MozMousePixelScroll', _onWheel, false );

If you are editing the minified version delete the following:

,this.addEventListener("MozMousePixelScroll",r,!1)
like image 86
zarax Avatar answered Nov 15 '22 05:11

zarax