This file contains hidden or 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
// how to detect flexbox support | |
// create a test div in the DOM | |
var div = document.createElement('div'); | |
// make sure the default value is display: block | |
div.style.display = 'block'; | |
// try some display values invoking flexbox | |
try { |
This file contains hidden or 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
var cw, pcw; | |
$(window).on('load resize', function () { | |
// get width as int | |
cw = parseInt($('.container').css('width')); | |
// make 'current !== previous' equation easier | |
if (cw < 750) {cw = 'xs';} | |
// execute breakpoint-specific action if the current container width is not the same as the previous one | |
if (cw !== pcw) { |