kodie
9/25/2015 - 4:01 PM

Get current page breakpoint

Get current page breakpoint

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;
}