LoginSignup
1
4

More than 5 years have passed since last update.

レスポンシブ対応の高速化

Posted at

コツ:なるべく、jqueryオブジェクト($(funciton(){});)の外側に条件分岐などのJavaScriptの記述を書くようにすること

// window幅の取得
var windowW = window.innerWidth;

// 条件分岐
if ( windowW >= 1025 ) {
    // 1025px以上の処理を記述
    $(function(){

    });
} else {
    // 1024px以下の処理を記述
    $(function(){

    });    
}
1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4