Instead, it is recommended to throttle the event using requestAnimationFrame(), setTimeout(), or a CustomEvent, as follows.. Examples Scroll event throttling. Since scroll events can fire at a high rate, the event handler shouldn't execute computationally expensive operations such as DOM modifications.