Skip to content

Instantly share code, notes, and snippets.

@kirkonrails
Created December 16, 2014 18:53
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 kirkonrails/e8787126dfaa6880842f to your computer and use it in GitHub Desktop.
Save kirkonrails/e8787126dfaa6880842f to your computer and use it in GitHub Desktop.
Simple javascript function return the current bootstrap breakpoint
window.getCurrentBreakpoint = ->
width = $(window).width()
if width < 768
"xs"
else if width < 992
"sm"
else if width > 991 && width < 1200
"md"
else if width >= 1200
"lg"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment