Last active
November 25, 2015 18:56
-
-
Save kodie/c9d152e750716b2a7340 to your computer and use it in GitHub Desktop.
Get current page breakpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function currentBreakpoint() { | |
var sm = 768; | |
var md = 992; | |
var lg = 1200; | |
var bp; | |
var win = window.innerWidth; | |
if (win < sm) { bp = 'xs'; } | |
if (win >= sm && win < md) { bp = 'sm'; } | |
if (win >= md && win < lg) { bp = 'md'; } | |
if (win >= lg) { bp = 'lg'; } | |
return bp; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment