My code is as such:
<div style="border: 2px solid black">
<marquee behavior="alternate" direction="down" width="100%" height="100%">
<marquee behavior="alternate" width="100%">
<button onClick="addPoints(1)">+1</button>
</marquee>
</marquee>
</div>
This makes it bounce around perfectly within a box container (border). However, the Marquee tag is depreciated and it doesn't give me enough control of the box. Is there an alternate solution, using jquery, javascript, CSS, or HTML? I need to be able to control the speed, detect when it hits a side, and find the X and Y of the button.
I had a working solution before, but it wouldn't let me stop and resume the animation at the same point (I need to be able to). I've seen other alternatives for Marquee but none seem to work the way I want them to, because they use the regular use of marquee rather than the behavior="alternate" setting. I'm experienced in javascript but jquery is new to me so any explanation is appreciated. Thanks!