/* ------------------------------------------- * @noConflict ------------------------------------------- */ jqNew = jQuery.noConflict(); if($ === undefined){ $ = jQuery; } j$ = jQuery || jqNew; /* ------------------------------------------- * @init ------------------------------------------- */ j$(window).on("load resize", function(){ var c = j$.extend({ typeLogout: ".typeLogout", typeLogIn: ".typeLogIn", expiration: 60 // 有効期限(日) }); // cookie取得関数 function getCookie(c_name){ var st = ""; var ed = ""; if(document.cookie.length>0){ // クッキーの値を取り出す st = document.cookie.indexOf(c_name + "="); if(st !== -1){ st = st+c_name.length+1; ed = document.cookie.indexOf(";",st); if(ed === -1) { ed=document.cookie.length; } // 値をデコードして返す return unescape(document.cookie.substring(st,ed)); } } return ""; } /* vars -------------------------------------------------- */ var $target_Out = $(".typeLogout"), $target_In = $(".typeLogIn"), $target_O_app = $(".appliBt.typeLogout"), $target_I_app = $(".appliBt.typeLogIn"), $win = $(window).width(); if($target_Out.length === 0){ return false; } $target_Out.hide(); $target_In.hide(); $target_O_app.hide(); $target_I_app.hide(); /* 会員cookieが無ければログアウトバナーを表示 */ if(getCookie("esc_if") === ""){ $target_Out.show(); if($win < 750){ $target_O_app.hide(); } else { $target_O_app.show(); } return false; } else { $target_In.show(); if($win < 750){ $target_I_app.hide(); } else { $target_I_app.show(); } return false; } });