dixonandmoe / rellax

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

Callbacks and doing things with them #239

Open yratof opened 2 years ago

yratof commented 2 years ago

Has anyone been able to use the callback to change anything outside of positions? It seems like it's not doing anything other than bringing back X & Y coordinates.

Examples welcomed here

sendy34 commented 2 years ago

@yratof Yes, for that you can bind a specific element with Rellax, so that you know about callback positions for that particular element. The positions are percentage based are generally revolves around center percentage data-rellax-percentage="0.5".

When you know that callback is for a specific element by binding it manually, you def can add some JS code based on positions.

It would be def great if Rellax would add additional elements in callback.