Skip to content

Instantly share code, notes, and snippets.



Created Nov 23, 2017
What would you like to do?
Get responsive breakpoint in Bootstrap 4 Beta
// Based on (credit
// Bootstrap 4 beta has changed the classes - they use d-*-none instead of hidden-*-up.
function getResponsiveBreakpoint() {
var envs = ["xs", "sm", "md", "lg", "xl"];
var env = "";
var $el = $("<div>");
for (var i = envs.length - 1; i >= 0; i--) {
env = envs[i];
$el.addClass("d-" + env + "-none");
if ($":hidden")) {
break; // env detected
return env;

This comment has been minimized.

Copy link

@sergey-dev sergey-dev commented Nov 23, 2017

thanks! that's true, they did update of classes names, again. Documentation can be found here:


This comment has been minimized.

Copy link
Owner Author

@gurubobnz gurubobnz commented Dec 3, 2017

^_^ Thanks sergey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment