Skip to content

Instantly share code, notes, and snippets.

@Hengjie
Created July 17, 2013 00:41
Show Gist options
  • 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