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

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