Image initial position?
See original GitHub issueCan we set an initial position for the image?
like, it start with top=100px
… so scroll on 100 to something?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Top Results From Across the Web
object-position - CSS: Cascading Style Sheets - MDN Web Docs
The first image is positioned with its left edge inset 10 pixels from the left edge of the element's box. The second image...
Read more >How to position an image in CSS - Javatpoint
There are many methods to position the image in CSS, such as using the object-position property, using the float property (for aligning the...
Read more >How to set position of an image in CSS ? - GeeksforGeeks
You can easily position an image by using the object-position property. ... float: none|inherit|left|right|initial;.
Read more >How to Position an Image in CSS? - Scaler Topics
You can easily position an image by using the object-position property. You can also use a bunch of other ways, like float-property, ...
Read more >CSS Layout - The position Property - W3Schools
The position property specifies the type of positioning method used for an element. There are five different position values: ... Elements are then...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey folks, sorry for the delay. This issue is open for quite a while and I don’t really know if it’s worth to introduce such an initial position. Maybe let’s discuss your use cases so I can understand a bit better. Because from my understanding the “initial position” would be the starting point when the image enters the screen while scrolling (bottom of viewport). But is this really what it is meant to be? I could also imagine that someone would like to steer the image position when its position is at the top of the viewport. So tell me 🙂 . The thing is, that there are so many different use cases which we cannot cover with one prop. And I fear that we will have a component which tries to solve everything but nothing really good.
The other point: I created a release candidate
3.0.4-rc.0
which hopefully solves the positioning on different screen sizes @xstable mentioned. Originally the calculation of the relative position was based on theviewport height + parallax content height
. So if you think of the scroll position as percentage value:0
-> top of the parallax component enters the screen when scrolling up1
-> bottom of parallax leaves the screen (top of the viewport)This was to prevent white background getting visible before the image leaves the screen. I checked the issue @xstable posted and decided that it’s also okay to only use the
viewport height
for calculation. White space would still not get visible as this part of the component is not in viewport anymore. This way you don’t have different positions on different screens.Can you check the release candidate
3.0.4-rc.0
onnpm
?Thanks
Any progress here? Not 100% sure, if thread-opener means this, but I found that the image doesn’t start at the same position if you have different Screen-width:
I would love to see that there is an option to place the Image to define where it should be start if the Parallax-Element come into view.