Browsers will nag you that the "page is running slow", because of the requestAnimationFrame running all the time.
This pull request will defer the update if no position is changed, and add the loop again if a resize, scroll, orientationchange or touchmove event is triggered.
It will also add scroll and touchmove events as passive.
Browsers will nag you that the "page is running slow", because of the
requestAnimationFrame
running all the time. This pull request will defer the update if no position is changed, and add the loop again if aresize
,scroll
,orientationchange
ortouchmove
event is triggered. It will also addscroll
andtouchmove
events as passive.