Check the JavaScript code and learn how to deal with mouse events properly.

Click with different mouse buttons, move the mouse...

Edit in JS Bin