dixonandmoe / rellax

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

Add Omni-Directional Support #176

Closed Your3Wishes closed 4 years ago

Your3Wishes commented 4 years ago

New data attributes to support different movement directions/speeds per scroll axis.

data-rellax-vertical-scroll-axis="y" - specify movement direction during vertical scrolling (can pass in xy for diagonal) data-rellax-horizontal-scroll-axis="x" - specify movement direction during horizontal scrolling (can pass in xy for diagonal) NOTE: You must still enable horizontal: true when initializing rellax to support horizontal movement during vertical scrolling.

data-rellax-vertical-speed="-2" - specify vertical movement speed data-rellax-horizontal-speed="-2" - specify horizontal movement speed

Added support for specifying min and max bounds for independent directions data-rellax-min-x data-rellax-max-x data-rellax-min-y data-rellax-max-y

Added directions.html for some simple cases during vertical scrolling