Use 2 spaces for indentation always
Support old jQuery.event.dispatch for jQuery <1.8

$.event.dispatch was undocumented and was deprecated in jQuery 1.7[1].
It was replaced by $.event.handle in jQuery 1.9.

Use the first of the available functions to support jQuery 1.7+.

[1] https://github.com/jquery/jquery-migrate/blob/master/src/event.js#L25
Add example page for testing

Original code can be found at
http://james.padolsey.com/demos/scrollevents/
Add jQuery plugin definition