Header scroll-event optimization