Stanko / react-plx

React parallax component, powerful and lightweight
https://muffinman.io/react-plx/
MIT License
689 stars 51 forks source link

react-plx and superposed html elements #66

Closed Githamza closed 4 years ago

Githamza commented 4 years ago

I have an issue this that if I want to animate an object under a png image, the animated inside Plx became on top

Here an example.

I would that the box stay under the image

https://codesandbox.io/s/react-plx-demo-9x0rj?file=/index.js

Stanko commented 4 years ago

Hello @Githamza, This is not an issue with the library, but with CSS in the example.

The image has no position set and Plx element has position: fixed.

You are either missing a z-index: -1 on Plx element, or position: "relative" on the image.

https://codesandbox.io/s/react-plx-demo-i7tus?file=/index.js

Hope that helps, cheers!