dixonandmoe / rellax

Lightweight, vanilla javascript parallax library
https://dixonandmoe.com/rellax/
MIT License
7.06k stars 878 forks source link

Left-Right Parallax? #186

Closed zaxwebs closed 3 years ago

zaxwebs commented 4 years ago

Any way to set the direction to be horizontal instead of vertical? If not, could this be added?

zaxwebs commented 4 years ago

Clarification: on vertical scroll.

zoh48gz04 commented 4 years ago
new Rellax('.rellax-h', { horizontal: true })
....
<div data-rellax-vertical-speed="0" data-rellax-horizontal-speed="5" data-rellax-vertical-scroll-axis="x"></div>

Works for me

ristarr11 commented 3 years ago

@zoh48gz04 solution works, but center can not be applied. Meaning, if the relax element is far below the fold, it will still get transform value changed as soon as the scroll on body starts. It seems horizontal scrolling ignores center: true and data-rellax-percentage="0.5". I hope maybe someone has found the solution for this scenario...

moeamaya commented 3 years ago

We don't plan to support this one