Make scrolling animation a little less hacky by putting most of it into a directive.