jQuery(function($){ //.rectの縦横比をレスポンシブに合わせて調整 function img_rect(){ var img_w = $(".rect").css("width"); var img_w3 = parseInt($(".tab_content").css("width")); var img_w3_d = img_w3 * 0.32; $(".rect").css('height',img_w); $(".rect3").css('height',img_w3_d); }; // $(window).resize(function(){ //$(window).on('load resize', function(){ $(window).on('load', function(){ img_rect(); }); var window_width = $(window).width(); if (window_width != $(window).width()) { $(window).on("resize",function(){ //$(window).on("orientationchange",function(){ img_rect(); //alert("画面が回転しました"); // ここに実行したい処理を書く }); } // img_rect(); }); jQuery(function($){ //.rectの縦横比をレスポンシブに合わせて調整 function img_rect2(){ var img_w2 = $(".rect2").css("width"); $(".rect2").css('height',img_w2); }; $(window).resize(function(){ img_rect2(); }); img_rect2(); }); /* jQuery(function($){ //.rectの縦横比をレスポンシブに合わせて調整 function img_rect3(){ var img_w3 = $(".rect3").css("width"); $(".rect3").css('height',img_w3); }; // $(window).resize(function(){ //$(window).on('load resize', function(){ $(window).on('load', function(){ img_rect3(); }); var window_width = $(window).width(); if (window_width != $(window).width()) { $(window).on("resize",function(){ //$(window).on("orientationchange",function(){ img_rect3(); //alert("画面が回転しました"); // ここに実行したい処理を書く }); } // img_rect(); }); */ $(window).on("orientationchange",function(){ //alert("画面が回転しました"); // ここに実行したい処理を書く });