wg178910 Posted December 12, 2023 Share Posted December 12, 2023 Hi everyone. I'm currently working on a project that uses scroll trigger pinning an element in a parent container. However, it comes to my notice that whenever I use a percentage in flex-basis, the child element's width changes from something like 123.34 to 124 whenever it is being pinned (just like the width of the blue box changing in the demo). This is a small difference but pretty noticeable on high resolution devices. Is there any solution to that? I know that I could pin the entire container but everything is already set up and I just don't want to tear everything down and rebuild everything. Thank you in advance. See the Pen qBgvzPL by Roy-M-the-animator (@Roy-M-the-animator) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted December 12, 2023 Share Posted December 12, 2023 If I understand your question correctly, no, I don't think so - browsers report offsetWidth as whole pixels, not fractions. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now