package scrolling logic into a jQuery plugin