handle scroll events in HTML