Javascript scroll event only once. So for your example, it would look like this: $(window).