dixonandmoe / rellax

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

Can Rellax be used to add parallax effect on background images inside divs? #223

Closed MontyHu closed 2 years ago

MontyHu commented 3 years ago

I didn't see an example of how to do this in the downloaded code, so wanted to ask here if Rellax is able to add the parallax effect to a background image of a div as it scrolls by in the viewport? If so, can anyone tell me how this would be done? I wasn't able to figure it out. Thanks!

raphaelbernhart commented 3 years ago

Hello,

yes you can create a image parallax effect with rellax: Demo

In this issue it is described why this is not implemented by default (background-image): Issue

Hope this helps you.

MontyHu commented 3 years ago

Hi Raphael, thank you very much for the Codepen demonstrating how to do this with Rellax!

moeamaya commented 2 years ago

Thanks @MontyHu