refactor begin_scrolling into shared.js