(function($){ $(function(){ setsize(); }); $(window).load(function(){ setsize(); }); $(window).resize(function () { setsize(); }); $(window).on('orientationchange', function(){ setsize(); }); function setsize(){ //ヘッダー高さ headh = $(".site-header").outerHeight(); //ヘッダーメニュー高さ headmh = 0;//$("#headmenu").outerHeight(); //スマホヘッダーメニュー位置 if($(window).width() <= 1023) { $("#headmenu").css("top",headh+"px"); $(".genesis-responsive-menu").css("top",(headh + headmh)+"px"); $(".site-container").css("padding-top",(headh + headmh)+"px"); }else{ $("#headmenu").removeAttr('style'); $(".genesis-responsive-menu").removeAttr('style'); $(".site-container").css("padding-top",headh +"px"); } //ヘッダーテキスト位置 $("#mainimg h1").css("padding-top",($("#mainimg").height()-$("#mainimg h1 img").height())/2 +"px"); //トップバナー $("#topbnr li:nth-child(1) a > img").css("margin-top",($("#topbnr li:nth-child(1)").height()-$("#topbnr li:nth-child(1) a > img").height())/2 +"px"); $("#topbnr li:nth-child(2) a > img").css("margin-top",($("#topbnr li:nth-child(2)").height()-$("#topbnr li:nth-child(2) a > img").height())/2 +"px"); $("#topbnr li:nth-child(3) a > img").css("margin-top",($("#topbnr li:nth-child(3)").height()-$("#topbnr li:nth-child(3) a > img").height())/2 +"px"); $("#topbnr li:nth-child(4) a > img").css("margin-top",($("#topbnr li:nth-child(4)").height()-$("#topbnr li:nth-child(4) a > img").height())/2 +"px"); } })(jQuery);