Skip to content

Instantly share code, notes, and snippets.

@gentoid
Created February 10, 2013 19:38
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 gentoid/4750759 to your computer and use it in GitHub Desktop.
Save gentoid/4750759 to your computer and use it in GitHub Desktop.
Breakpoints for adaptive design
function isBreakPoint(bp) {
// The breakpoints that you set in your css
var bps = [320, 480, 768, 1024];
var w = $(window).width();
var min, max;
for (var i = 0, l = bps.length; i < l; i++) {
if (bps[i] === bp) {
min = bps[i-1] || 0;
max = bps[i];
break;
}
}
return w > min && w <= max;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment