Prevent unnecessary famous javascript + dom calls when scrolling