Posted May 30, 2021 Hey so I have an animation of a ninja sprite running down and slicing with his sword and for it to look good it has to be on one line of the page(all the images are inline they are on one line) and at some point it goes out of the creen and I have to scroll. I was wondering how do I use this to set the scrolling position to the Y of the ninja so it autoscrolls when he goes off screen const el = document.querySelector('.btn'); // set scroll position in px el.scrollLeft = ninja.x? let's say the object is named ninja,so how do I make this correct? Link to comment Share on other sites More sharing options... Link to post Share on other sites More sharing options...
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