Skip to content

Instantly share code, notes, and snippets.

@rhumlover
Created January 10, 2014 01:30
Show Gist options
  • Save rhumlover/8345453 to your computer and use it in GitHub Desktop.
Save rhumlover/8345453 to your computer and use it in GitHub Desktop.
# Disable and enable event on scroll begin and scroll end.
# @see http://www.thecssninja.com/javascript/pointer-events-60fps
root = document.documentElement
timer = null
window.addEventListener 'scroll', ->
clearTimeout timer
# Pointer events has not already been disabled.
if not root.style.pointerEvents
root.style.pointerEvents = 'none'
timer = setTimeout ->
root.style.pointerEvents = ''
, 333
, false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment