which is the fastest and easy way to fire when bootstrap-responsive.css media queries go in action?
go in action = when you resize window to mobile width and site is
Improving the excellent @falsarella answer, here is a shorter version that works with Bootstrap 4 :
#mq-detector {
visibility: hidden;
}
//Define function that returns the currently used media query
function getBsMq(){
var currMq;
var mqDetector = $('#mq-detector [data-mq]');
mqDetector.each(function(i){
if ($(this).is(':visible')) {
currMq = $(this).attr('data-mq');
}
});
return currMq;
}
//Call the function and get the currently used media query
alert(getBsMq());