Is it possible to get the current screen mode without having to code a function which works with media queries?
e.g. I have a container-fluid
div with class chartContainer
.
.chartContainer {
padding-top: 20px;
padding-bottom: 50px;
padding-left: 120px;
padding-right: 120px;
}
But I only need the class chartContainer
if the screen size is not xs
or sm
.
Are there bootstrap methods to find this out, without having to code own functions?
e.g. I would do something like this, which is quick and dirty but should work if the window size changes:
setInterval(function() {
if (BOOTSTRAP_CURRENT_SCREEN_MODE == 'xs' || BOOTSTRAP_CURRENT_SCREEN_MODE == 'sm') {
$(".container-fluid").removeClass("chartContainer");
} else {
$(".container-fluid").addClass("chartContainer");
}
},100);
Is there something like BOOTSTRAP_CURRENT_SCREEN_MODE
?
How would I achieve my goal the best way?