ブラウザ幅で分岐 Bootstrap参考: xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px const mq = []; mq.mobile = Modernizr.mq('(max-width: 575px)'); mq.tablet = Modernizr.mq('(min-width: 576px) and (max-width: 991px)'); mq.desktop = Modernizr.mq('(min-width: 992px)'); if ( mq.mobile ) { モバイル表示のみ処理させたい処理 } if ( mq.desktop ) { デスクトップ表示のみ処理させたい処理 }