画面サイズが変更された時に処理を行うには、.resize()を使用します。
サンプルソース
例)画面サイズ変更時にコンソールに画面サイズを出力する
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  | 
						<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>サンプル</title> <script src="http://code.jquery.com/jquery-3.2.1.min.js"></script> <script> $(function(){   //画面サイズ変更時に呼ばれる   $(window).resize(function(){     var w = $(window).width();   //画面のwidthを取得     var h = $(window).height();  //画面のhightを取得     console.log(w + "x" + h);   }); }); </script> </head> <body>   <p>test</p> </body> </html>  | 
					
実行サンプル
画面サイズを変更すると、現在の画面サイズを表示します。