malihu/malihu-custom-scrollbar-plugin — pull request #44 by lawrencepit (2013-03-27 04:09:10+00:00)
Title: options.snapAmount : always snaps to a multiple of this number in pixels

This patch allows to set an option `snapAmount`. When set the content will always snap to a multiple of that number in pixels.

See the demo in `grid_and_snap_while_scrolling_example.html`

Why?

If you look at the demo `scroll_buttons_and_snap_scrolling_examples.html` then it snaps when you use the buttons. However, when you scroll it ends up in a position that is not snapped.

If you have a grid and you scroll then the grid normally scrolls too. You easily end up in a situation where the top of the grid shows only a part of a row. The major downside of the grid lines scrolling is that it's also very uneasy on the eyes with all the lines moving.

With this `snapAmount` option you can scroll a grid while the grid seems to stay in place. Only the content within the grid seems to move. This makes it easy on the eyes. In addition no row is every shown partly. So the grid stays clean.

As far as I know this is the only javascript scrollbar component that can handle this.

The inspiration for this is taken from the way Google Drive's Spreadsheet scrolls cells within a grid.