buster808 Posted March 31, 2021 Share Posted March 31, 2021 Hi, this is code from a tutorial and am having difficulty understanding it. I want the bus to start offscreen from the left and finish to the right. Thanks for any help. See the Pen yLgVqba by buster808 (@buster808) on CodePen Link to comment Share on other sites More sharing options...
Solution mikel Posted March 31, 2021 Solution Share Posted March 31, 2021 Hey @buster808, If #bus has a width of 500px (see CSS) Set it position: absolute; left:-500; The trigger should be #bus and the x-transform end: width + 500; Use a correct ease - I prefer 'none' I modified start and end values See the Pen WNRoBym?editors=1010 by mikeK (@mikeK) on CodePen Happy tweening ... Mikel 3 Link to comment Share on other sites More sharing options...
buster808 Posted March 31, 2021 Author Share Posted March 31, 2021 Thanks Mikel much appreciated. Link to comment Share on other sites More sharing options...
Scratchytube Posted February 17, 2023 Share Posted February 17, 2023 It does seem though that after the bus gets to its final destination the viewport stretches out to the right. Link to comment Share on other sites More sharing options...
Cassie Posted February 17, 2023 Share Posted February 17, 2023 You can add 'overflow-x:hidden' on the container or body to stop that happening. https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-x 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