Closed ekiwi111 closed 2 years ago
I'm not sure I understand what the end result should look like. Can you share how they should be positioned when "overlapping'? Drawing or demo?
Position absolute removes the element from the document flow, so if the child of a <Parallax />
element is absolute, there may be no height/width for the element to base the translation on.
Send me the intended end result and I can attempt to mock it up for you if it's possible.
I'm not sure I understand what the end result should look like. Can you share how they should be positioned when "overlapping'? Drawing or demo?
Position absolute removes the element from the document flow, so if the child of a
<Parallax />
element is absolute, there may be no height/width for the element to base the translation on.Send me the intended end result and I can attempt to mock it up for you if it's possible.
Thanks for your reply. So the rough idea of what I'd like to achieve is on the sketch below. A number of divs would move out of the viewport on scroll and most of them overlap at the start of the transition.
Ok interesting -- It will be a little tricky to get them positioned perfectly** but if you style the <Parallax>
element for positioning instead of the child box, you can probably get close. See this:
https://codesandbox.io/s/long-morning-i4w3d?file=/src/App.js
**because the elements are starting within the view they will be midway through their transition between the given values [0, 100]
, see this issue for more detail: #122
Something I want to allow configuration to change the above behavior in a future version #123
Thanks heaps! Exactly what I need. Also thanks for pointing at #122, was wondering that too.
Trouble With Implementation
Describe the trouble you are having considering the following: I can't seem to find a way to get parallax working in the example below. I'd like to use multiple divs that overlapping each other as they are all
position: absolute
and get them to move while scrolling (each would contain an image). WhenBox
component has no CSS propertyposition: absolute
it works fine, but that's not what I want. Any help appreciated!Can you share the repository, live site, or a demo? CodeSandbox
Are you seeing any errors or warnings? No