cubiq / iscroll

Smooth scrolling for the web
http://iscrolljs.com
MIT License
12.88k stars 3.81k forks source link

scrollToElement not setting current position #1151

Closed sambengtson closed 7 years ago

sambengtson commented 7 years ago

Usage is:

scroll.scrollToElement(scrollElement, 600, 0, -50, IScroll.utils.ease.circular);

If calling next() or prev() shortly after, it seems that it scrolls all the way back to the top and focuses on the second element. Am I missing something here? I've tried a couple of things without much luck.

jonkrusell commented 7 years ago

scrollToElement never sets the currentPage

Here's my fork with a fix:

https://github.com/jonkrusell/iscroll/commit/34bfcff1a0e596e89aa2d0fbfb7a563ced4ce2a2

sambengtson commented 7 years ago

@jonkrusell Thanks. Glad somebody is paying attention on here.