How to - gallery like this?

Hi! Does anyone have any idea about how these kind of gallery are made?

http://s3.envato.com/files/32581/index.html
http://s3.envato.com/files/30937/index.html

In particular, I’d like to understand how to make the mousemove scrolling.

Probably by detecting mouse direction and then sliding thumbs based on distance, but I can’t figure out the precise way, and also I’d like to know if there’s a better way among others.