Prinzhorn / skrollr-menu

skrollr plugin for hash navigation
MIT License
285 stars 143 forks source link

User function to compute duration #9

Closed ydm closed 11 years ago

ydm commented 11 years ago

These changes enhance the skrollr menu plugin by adding the option to provide a user defined function to compute animation duration. The user function is called with two arguments: currentTop (the current top scroll position in pixels) and targetTop, which is the top scroll position we'll have after animating. This way users can set the animation duration dynamically as they like, for example according to distance.

Prinzhorn commented 11 years ago

I like the idea. Don't have time to check and pull it right now.

ydm commented 11 years ago

The main changes are in https://github.com/ydm/skrollr-menu/commit/6c7c11aad916d1050f108455b78a3d4827b2399c . It's something really trivial and it would be great if you can spare just a minute to review it. Otherwise I'm afraid the feature will be dropped and I believe that should not happen, because it's useful for a number of cases.

Prinzhorn commented 11 years ago

screenshot from 2013-07-12 09 27 10

ydm commented 11 years ago

My bad, I'm sorry. All errors are fixed now and the changed file is lint free.