Skip to content

Commit 9113a04

Browse files
committed
set current scroll on updates #79 #65
1 parent 0194815 commit 9113a04

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/classes/ParallaxController.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ function ParallaxController({ scrollAxis = VERTICAL, scrollContainer }) {
197197
* Updates all parallax element attributes and positions.
198198
*/
199199
this.update = function() {
200+
const nx = hasScrollContainer ? viewEl.scrollLeft : window.pageXOffset;
201+
const ny = hasScrollContainer ? viewEl.scrollTop : window.pageYOffset;
202+
scroll.setScroll(nx, ny);
203+
200204
_setViewSize();
201205
_updateAllElements({ updateCache: true });
202206
};

0 commit comments

Comments
 (0)