jlmakes / scrollreveal

Animate elements as they scroll into view.
https://scrollrevealjs.org/
22.33k stars 2.26k forks source link

improve scrolling performance #499

Closed dadmor closed 5 years ago

dadmor commented 5 years ago

FIX: Does not use passive listeners to improve scrolling performance

fieg commented 5 years ago

Interesting, but I read this from the docs:

You don't need to worry about the value of passive for the basic scroll event. Since it can't be canceled, event listeners can't block page rendering anyway.

https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Improving_scrolling_performance_with_passive_listeners

jlmakes commented 5 years ago

I appreciate the thought @dadmor but as @fieg pointed out, this doesn’t apply to scroll events. (In fact, this has come up before! #416)