Yes! I made it! I’m back up to speed, thanks to a super fun and simple project in the final hours of the day. Once again, thanks boyfriend for the funny idea; A button that says “click here to get all the secrets of the world” and when you hover, it moves to a random location on the page. Buuuuut IF you succeed in pressing it, you will have the secret answered by a very cute puppy!
And I learned:
- Again, I used the Math.random() function (will need to try something new soon) to set a random top and left position of the button.
- In order for the button to stay on the page and not go off screen, we figured out that we could use .innerHeight and .innerWidth to figure out what the max top and left position could be. I subtracted the height and width of the button.