$(function(){ //■■■■ (スマホ用)TOPでの地図検索窓OPEN&CLOSE $mapClick = $(".top_map article div em"); $mapClose = $(".top_map article div div a.close"); $mapClick.on('click', function(){ $(this).next().fadeIn(200); }); $mapClose.on('click', function(){ $(this).parent().parent().fadeOut(200); }); //■■■■ 他の地域から探すボタン $(".right_button em").on('click', function(){ $(this).next().slideToggle(200); }); $(".right_button p a.close").on('click', function(){ $(".right_button p").slideToggle(200); }); //■■■■ パーティーリスト 日時切り替え $partyTab = $(".tab_date span"); $partyList = $(".party_list"); $partyList.hide(); $partyList.eq(0).show(); $partyTab.on('click', function(){ $partyTab.removeClass("on"); $(this).addClass("on"); $partyList.hide(); $partyList.eq($(this).index()).fadeIn(300); }); //■■■■ カレンダー $(window).resize(function(){ if($(window).width() < 800){ CalWidth = 100; $calAll.animate({ left: -DefaultCalendar*CalWidth + "%" }, 100 ); $calAll.css("width", (calendarTimes*CalWidth) + "%" ); $("#calendar_all > div").css("width" ,(100 / calendarTimes) + "%" ); }else{ CalWidth = 33.333333; $calAll.animate({ left: -DefaultCalendar*CalWidth + "%" }, 100 ); $calAll.css("width", (calendarTimes*CalWidth) + "%" ); $("#calendar_all > div").css("width" ,(100 / calendarTimes) + "%" ); } }); if($(window).width() < 800){ CalWidth = 100; $calAll.css("width", (calendarTimes*CalWidth) + "%" ); $("#calendar_all > div").css("width" ,(100 / calendarTimes) + "%" ); }else{ CalWidth = 33.333333; $calAll.css("width", (calendarTimes*CalWidth) + "%" ); $("#calendar_all > div").css("width" ,(100 / calendarTimes) + "%" ); } $topcalPrev = $(".top_calendar a.prev"); $topcalNext = $(".top_calendar a.next"); $topcalPrev.addClass("off"); $topcalPrev.on('click', function(){ if( DefaultCalendar > 0){ DefaultCalendar--; $topcalNext.removeClass("off"); $calAll.animate({ left: -DefaultCalendar*CalWidth + "%" }, 800 ); if ( DefaultCalendar == 0 ){ $(this).addClass("off"); }else{ $(this).removeClass("off"); } } }); $topcalNext.on('click', function(){ if( DefaultCalendar < calendarTimes - 3){ DefaultCalendar++; $topcalPrev.removeClass("off"); $calAll.animate({ left: -DefaultCalendar*CalWidth + "%" }, 800 ); if ( DefaultCalendar == calendarTimes - 3 ){ $(this).addClass("off"); }else{ $(this).removeClass("off"); } } }); });