Taun Posted October 31, 2023 Share Posted October 31, 2023 Hi. I don't understand why my code isn't rendering? When I got it to render in VSCode, it rendered the images vertically in a column, not horizontally. I thought flex-direction:row would make the slider display in a row? Code Sandbox: https://codesandbox.io/s/gsap-horizontalscrolltrigger-mz7d68?file=/src/components/scrollsection.scss:47-167 .scroll-section-inner { height: 100vh; width: 100vw; display: flex; flex-direction: row; position: relative; } Link to comment Share on other sites More sharing options...
Rodrigo Posted October 31, 2023 Share Posted October 31, 2023 Hi, A few things. Your demo is not working. I reloaded it a few times and it stays white. Using display flex is not enough to get things working for horizontal sections. You also need to set the flex container to not wrapping it's child elements if they exceed the width and the flex basis property of the child elements as well. Here are a couple of demos that show how the CSS is constructed: See the Pen RwvNamq by GreenSock (@GreenSock) on CodePen See the Pen eYbqrLZ by GreenSock (@GreenSock) on CodePen Hopefully this helps. Happy Tweening! Link to comment Share on other sites More sharing options...
Taun Posted October 31, 2023 Author Share Posted October 31, 2023 Thanks! 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