If you click a button the red square will start moving. The movement will stop when you stop pressing the button

We have added the ontouchstart event on the buttons, to make this example work for touch devices.