Build a Mousewheel with Arduino and JavaScript

So you wanna do something like this?

A rotary encoder is easily decoded with an Arduino (Arduino Playground - RotaryEncoders), the connection to javascript can be done via several ways, depending on your environment, the easiest is a direct connection to the server hosting the web page, another that addition of an Ethernet shield and also possible: providing some JSON of the WiFi shield.