pixelcog / parallax.js

Simple parallax scrolling effect inspired by Spotify.com implemented as a jQuery plugin
MIT License
3.53k stars 840 forks source link

Support parallax for mobile devices #223

Closed ktsn closed 2 years ago

ktsn commented 6 years ago

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:

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!

cfriedt commented 6 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.

BraveLilToaster commented 6 years ago

Just tested it as well. Looks great. I'm going to be pushing this out to some sites right now.

oliverschloebe commented 4 years ago

Tested on Android 9 (Chrome 78) and iOS 13 (Safari) and it's working fine. Thanks for this. 👍

jtsimoes commented 4 years ago

I love this! You really need to merge it! @wstoettinger