Skip to content

Instantly share code, notes, and snippets.

@Hengjie
Created July 17, 2013 00:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hengjie/6016646 to your computer and use it in GitHub Desktop.
Save Hengjie/6016646 to your computer and use it in GitHub Desktop.
Modernizr orientationchange test in CoffeeScript
# Chrome Android tends to fire 'resize' events on scroll
# This detects it to run certain code using $(window).bind 'orientationchange'
# instead of $(window).resize
Modernizr.addTest 'orientationchange', ->
return !!(window.orientation? and Modernizr.touch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment