Last active
October 1, 2018 20:50
-
-
Save luislobo14rap/e1336223f99d509a2651e27df87edfcb to your computer and use it in GitHub Desktop.
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
// getBootstrap4Grid.js v1.2.1 | |
function getBootstrap4Grid( windowWidth = window.outerWidth ){ | |
if( typeof windowWidth == 'string' ){ | |
windowWidth = +windowWidth; | |
}; | |
if( windowWidth == 1 ){ | |
windowWidth = window.outerWidth; | |
windowWidth = ( windowWidth < 576 ) ? windowWidth = 1 : windowWidth; | |
windowWidth = ( windowWidth >= 576 && windowWidth < 768 ) ? windowWidth = 2 : windowWidth; | |
windowWidth = ( windowWidth >= 768 && windowWidth < 992 ) ? windowWidth = 3 : windowWidth; | |
windowWidth = ( windowWidth >= 992 && windowWidth < 1200 ) ? windowWidth = 4 : windowWidth; | |
windowWidth = ( windowWidth >= 1200 ) ? windowWidth = 5 : windowWidth; | |
return windowWidth; | |
}; | |
if( typeof windowWidth == 'number' && windowWidth.toString() != 'NaN' ){ | |
windowWidth = ( windowWidth < 576 ) ? windowWidth = 'xs' : windowWidth; | |
windowWidth = ( windowWidth >= 576 && windowWidth < 768 ) ? windowWidth = 'sm' : windowWidth; | |
windowWidth = ( windowWidth >= 768 && windowWidth < 992 ) ? windowWidth = 'md' : windowWidth; | |
windowWidth = ( windowWidth >= 992 && windowWidth < 1200 ) ? windowWidth = 'lg' : windowWidth; | |
windowWidth = ( windowWidth >= 1200 ) ? windowWidth = 'xl' : windowWidth; | |
return windowWidth; | |
}; | |
return false; | |
}; |
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
// getBootstrap4Grid.min.js v1.2.1 | |
function getBootstrap4Grid(a=window.outerWidth){return('string'==typeof a&&(a=+a),1==a)?(a=window.outerWidth,a=576>a?a=1:a,a=576<=a&&768>a?a=2:a,a=768<=a&&992>a?a=3:a,a=992<=a&&1200>a?a=4:a,a=1200<=a?a=5:a,a):'number'==typeof a&&'NaN'!=a.toString()&&(a=576>a?a='xs':a,a=576<=a&&768>a?a='sm':a,a=768<=a&&992>a?a='md':a,a=992<=a&&1200>a?a='lg':a,a=1200<=a?a='xl':a,a)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment