Skip to content

Instantly share code, notes, and snippets.

@asilbalaban
Created September 14, 2016 08:45
Show Gist options
  • Save asilbalaban/3df710789f16981fb935489f30ea5d6b to your computer and use it in GitHub Desktop.
Save asilbalaban/3df710789f16981fb935489f30ea5d6b to your computer and use it in GitHub Desktop.
bootstrap responsive breakpoints detector
function responsive ()
{
if ($(window).width() < 768) {
console.log('xs');
}
else if ($(window).width() >= 768 && $(window).width() <= 992) {
console.log('sm');
}
else if ($(window).width() > 992 && $(window).width() <= 1200) {
console.log('md');
}
else {
console.log('lg');
}
}
responsive();
$(window).on('resize', responsive);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment