dixonandmoe / rellax

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

Rellax with SVG? #171

Open poobutt opened 5 years ago

poobutt commented 5 years ago

Hey, I'm fairly new so forgive me if this is simple.

Is there a way to have objects inside SVG code to have the Rellax parallax effect?

For example, this is an object inside the SVG I'm using, but this is not working: <polygon class="k rellax" data-rellax-speed="4" points="0 239.67 0 385.38 0.42 385.14 126.58 313.68 0 239.67"></polygon>

I would just do this with CSS or multiple images, but there are a lot of objects and with the SVG the objects are already positioned correctly...

joshwaaaah commented 4 years ago

Try adding an SVG group around it and putting the Rellax stuff on there, I've done that in the past and it did the trick.