bratsun
3/9/2015 - 11:02 AM

Bootstrap breakpoint checker

Bootstrap breakpoint checker

function isBreakpoint( alias ) {
  return $('.device-' + alias).is(':visible');
}

if (isBreakpoint('lg')) { // lg, md, sm, xs
  // do stuff
}
<div class="device-xs visible-xs"></div>
<div class="device-sm visible-sm"></div>
<div class="device-md visible-md"></div>
<div class="device-lg visible-lg"></div>