maciej-gurban / responsive-bootstrap-toolkit

Responsive Bootstrap Toolkit allows for easy breakpoint detection in JavaScript
MIT License
363 stars 89 forks source link

doesn't correct work with <md condition #55

Closed mykola-shkut closed 5 years ago

mykola-shkut commented 5 years ago

if I'm on "md" breakpoint and in js have

if (viewport.is("<md")) {
    console.log('hide block');
} else {
   console.log('show block');
}

I expect get 'show block' but have 'hide block'

mykola-shkut commented 5 years ago

forget problem was with bootsrap4 so fix for it is to use divs "xs": $("

", {"class" : "device-xs d-none d-xs-block d-sm-none"}), "sm": $("
", {"class" : "device-sm d-none d-sm-block d-md-none"}), "md": $("
", {"class" : "device-md d-none d-md-block d-lg-none"}), "lg": $("
", {"class" : "device-lg d-none d-lg-block d-xl-none"}), "xl": $("
", {"class" : "device-xl d-none d-xl-block"})