Closed ktsn closed 2 years ago
I tested this on Android 7.0.0 (Chrome 62 something) and iOS 11.2 (Safari) and it worked in both cases when androidDisabled and iosDisabled were initialized to false.
Just tested it as well. Looks great. I'm going to be pushing this out to some sites right now.
Tested on Android 9 (Chrome 78) and iOS 13 (Safari) and it's working fine. Thanks for this. 👍
I love this! You really need to merge it! @wstoettinger
Hello! I have read the past issue #67 and I see why parallax.js does not support mobile devices. However, looks like the recent mobile devices fire scroll event during the user is scrolling the window, not only when the scroll is finished.
In addition, I seem we can handle the scroll event by using
touchmove
event for old devices.So I've added mobile device support in this PR. The PR includes:
iosDisabled
andandroidDisabled
options for backward compatibility (default istrue
)touchmove
event listener for old devices that does not handlescroll
event during scrolling.passive
event listener if possible.I've tested this change with iOS/Android devices which I have by using this code. https://github.com/ktsn/parallax.js-test
If I'm missing something important to support mobile devices. Please let me know.
Thank you!