I want my buttons on my page to go from the left/right to the center when the page loads. Is there a way I can do it? I wanna make the first one from left, second from right, etc. I'm thinking of using tags for each button- #button1, #button2 etc- and using CSS to make the animations, but don't know how. Can anyone help? (If you know a JS way that works too, but I don't know too much JS or CSS as of now. I know more CSS than JS so CSS if preferred)
Asked
Active
Viewed 53 times
-4
-
Hello, welcome to StackOverflow :) Please visit [Help Center](https://stackoverflow.com/help) and take the [tour](https://stackoverflow.com/tour) to see how to properly ask a question. In order to better assist you, could you provide us with the code you're working with ? – Oddrigue Feb 28 '20 at 16:00
-
I haven't really started code because I don't know how to start it off but here's the button code:
-
Could you add your code in your question by editing your question ? Bear in mind that any relevant code or information relative to your question should be in the question body, not in comments :) – Oddrigue Feb 28 '20 at 16:04
1 Answers
0
Definitely put IDs on your elements, and wait until the page is loaded/ready (window.onload vs $(document).ready())
Are you only trying to alter the x-position of your elements? You should be able to set a JS function that listens for the page to be ready and then just kick off your animation, whether in CSS or JS.

awesame
- 84
- 2
- 13