1

Is there a fast easy way to query the console for the column category (xs sm md lg) used in the current viewport size?

Octavian
  • 4,519
  • 8
  • 28
  • 39

3 Answers3

1

Ok, I wrote a simple function for this, seems there is no native way to do this.

function bootstrapSize() {
    switch(true) {
        case window.innerWidth > 1200: return 'lg';
        case window.innerWidth > 992: return 'md';
        case window.innerWidth > 768: return 'sm';
        default: return 'xs';
    }
}
Octavian
  • 4,519
  • 8
  • 28
  • 39
0

There is no built-in way to do this from the console, but you might use the technique described in https://stackoverflow.com/a/22885503/65971 to create your code snippet to query this from the console.

For each breakpoint it creates a <div> for example <div class="visible-xs-block" /> on which it tests if it's visible.

Community
  • 1
  • 1
ckuijjer
  • 13,293
  • 3
  • 40
  • 45
-1

Have you tried using hasClass() ?

http://api.jquery.com/hasclass/

Jossi Fresco
  • 415
  • 4
  • 3