Could do with some smoothing and polishing. Jerks all over the place. Also, what is with this new fashion of declaring functions as anonymous methods? var recalculateLimits = function () { /* snip */ }; var update = function () { recalculateLimits(); onScroll(); }; Have I missed a memo? EDIT: I forgot to say apart from my moaning, does the job, good code, good job! And it's only jerky when you use the scroll button o…
From the other commenter's SO link, I found this link to go more in depth into the differences of declaring functions, and it seems to come down to having stricter control on the order of events with no surprises.
http://javascriptweblog.wordpress.com/2010/07/06/function-de...
And here's an example of one of the surprises you'll run into if you don't declare your functions in this way: http://www.adequatelygood.com/JavaScript-Scoping-and-Hoistin...