Made a jquery plugin of this excellent script.
Merge pull request #1 from bohemel/master

Awesome, thanks!