(function($) { $(function() { if($('#rightNavPoint').size() > 0) { $('#rightNavPoint').after($('#rightNav')); } if($('#rentalAreaPoint').size() > 0) { $('#rentalAreaPoint').after($('#rentalArea')); } var menuBtn = document.getElementById('bMenuOpen'); var menuContent = document.getElementById('bMenuContent'); menuBtn.addEventListener('click', function(e) { menuContent.classList.toggle('show'); menuBtn.classList.toggle('open'); }, false); var $leftNavOpenBtn = $('#leftNavOpen'); var $leftSearch = $('#leftSearch'); var slideSpeed = 300; $leftNavOpenBtn.on('click', function() { $leftSearch.slideToggle(slideSpeed); }); var $leftSearchHeading = $('.js_leftSearchHeading'); if($leftSearchHeading.size() > 0 && $('.js_leftSearchList').size() > 0) { $leftSearchHeading.on('click', function() { $leftSearchHeading.not(this).removeClass('open'); $leftSearchHeading.not(this).next('.js_leftSearchList').slideUp(slideSpeed); $(this).toggleClass('open'); $(this).next('.js_leftSearchList').slideToggle(slideSpeed); }); } /*202303修正*/ var $pcSubMenu = $('#nav-sub'); var $pcSubMenuOpen = $('#js_subMenuOpen'); $pcSubMenuOpen.on('click', function() { $pcSubMenu.slideToggle(slideSpeed); $('#nav-sub-2').slideUp(slideSpeed); $('#nav-sub-3').slideUp(slideSpeed); $('#nav-sub-4').slideUp(slideSpeed); return false; }); $(document).on('click touchend', function(e) { if (!$(e.target).closest('#nav-sub').length) { $('#nav-sub').slideUp(slideSpeed); } }); var spWidth = 641; $(window).on('load resize', function() { var width = $(this).width(); if(width < spWidth) { console.log('sp'); } else { $leftSearch.css('display', ''); $pcSubMenu.css('display', ''); } }); var $pcSubMenu2 = $('#nav-sub-2'); var $pcSubMenuOpen2 = $('#js_subMenuOpen-2'); $pcSubMenuOpen2.on('click', function() { $pcSubMenu2.slideToggle(slideSpeed); $('#nav-sub').slideUp(slideSpeed); $('#nav-sub-3').slideUp(slideSpeed); $('#nav-sub-4').slideUp(slideSpeed); return false; }); $(document).on('click touchend', function(e) { if (!$(e.target).closest('#nav-sub-2').length) { $('#nav-sub-2').slideUp(slideSpeed); } }); var spWidth = 641; $(window).on('load resize', function() { var width = $(this).width(); if(width < spWidth) { console.log('sp'); } else { $leftSearch.css('display', ''); $pcSubMenu2.css('display', ''); } }); var $pcSubMenu3 = $('#nav-sub-3'); var $pcSubMenuOpen3 = $('#js_subMenuOpen-3'); $pcSubMenuOpen3.on('click', function() { $pcSubMenu3.slideToggle(slideSpeed); $('#nav-sub').slideUp(slideSpeed); $('#nav-sub-2').slideUp(slideSpeed); $('#nav-sub-4').slideUp(slideSpeed); return false; }); $(document).on('click touchend', function(e) { if (!$(e.target).closest('#nav-sub-3').length) { $('#nav-sub-3').slideUp(slideSpeed); } }); var spWidth = 641; $(window).on('load resize', function() { var width = $(this).width(); if(width < spWidth) { console.log('sp'); } else { $leftSearch.css('display', ''); $pcSubMenu2.css('display', ''); } }); var $pcSubMenu4 = $('#nav-sub-4'); var $pcSubMenuOpen4 = $('#js_subMenuOpen-4'); $pcSubMenuOpen4.on('click', function() { $pcSubMenu4.slideToggle(slideSpeed); $('#nav-sub').slideUp(slideSpeed); $('#nav-sub-2').slideUp(slideSpeed); $('#nav-sub-3').slideUp(slideSpeed); return false; }); $(document).on('click touchend', function(e) { if (!$(e.target).closest('#nav-sub-4').length) { $('#nav-sub-4').slideUp(slideSpeed); } }); var spWidth = 641; $(window).on('load resize', function() { var width = $(this).width(); if(width < spWidth) { console.log('sp'); } else { $leftSearch.css('display', ''); $pcSubMenu2.css('display', ''); } }); /*202303修正ここまで*/ var $floatArea = $('.js_floatArea'); $(window).on('load scroll', function() { var scrollTop = $(this).scrollTop(); $floatArea.each(function() { var $floatItem = $(this).find('.js_floatItem'); var thisTop = $(this).offset().top; var thisHeight = $(this).height(); var itemHeight = $floatItem.height(); if(thisHeight < itemHeight) { $floatItem.removeClass('fix staticBottom'); } else if(scrollTop > thisTop && scrollTop + itemHeight < thisTop + thisHeight) { $floatItem.removeClass('staticBottom').addClass('fix'); } else if(scrollTop + itemHeight >= thisTop + thisHeight) { $floatItem.removeClass('fix').addClass('staticBottom'); } else { $floatItem.removeClass('fix staticBottom'); } }); }); var mySwiper = new Swiper('.bnr_slider .swiper-container', { slidesPerView: 3, spaceBetween: 30, autoplay: 5000, nextButton: '.swiper-button-next', prevButton: '.swiper-button-prev', breakpoints: { 640: { slidesPerView: 1, spaceBetween: 0 } } }); var mySwiper = new Swiper('.slider-box .swiper-container', { infinite: true, arrows: true, centerMode: true, slidesToShow: 1, loop: true, slidesPerView: 1.3, spaceBetween: 10, centeredSlides : true, nextButton: '.swiper-button-next', prevButton: '.swiper-button-prev', breakpoints: { 640: { slidesPerView: 1, spaceBetween: 0 } } }); /*var mySwiper = new Swiper('.slider-box .swiper-container', { autoplay: false, autoplaySpeed: 5000, infinite: true, arrows: true, dots: true, centerMode: true, slidesToShow: 1, centerPadding: '22%', responsive: [ { breakpoint: 768, //767px以下のサイズに適用 settings: { centerPadding: '0%', } } ] });*/ var mySwiper = new Swiper('.sp-slide .swiper-container', { slidesPerView: 2, spaceBetween: 15, loop: true, autoplay: 5000, nextButton: '.swiper-button-next', prevButton: '.swiper-button-prev' }); $(".bsitemap_parent_ttl a").on("click", function () { if ($(window).width() < 640) { if ($(this).parent().next(".bsitemap_child").length > 0) { if ($(this).parents(".bsitemap_parent").hasClass("is_open")) { $(this).parents(".bsitemap_parent").removeClass("is_open"); $(this).parent().next(".bsitemap_child").stop().slideUp(300); } else { $(this).parents(".bsitemap_parent").addClass("is_open"); $(this).parent().next(".bsitemap_child").stop().slideDown(300); } return false; } } }); var params = getParameter(); var categories = [ { key: 'scale', class: '.js_categoryList', attr: 'data-category' }, { key: 'job', class: '.js_industryList', attr: 'data-industry' }, { key: 'theme', class: '.js_themeList', attr: 'data-theme' }, ]; setLeftSearch(); function setLeftSearch() { $leftSearchInputs = $('.js_leftSearchList input[type=checkbox]'); if($leftSearchInputs.size() < 1) { return; } for(var i = 0; i < categories.length; i++) { var $inputs = $(categories[i].class + ' input'); if($inputs.size() < 1) { continue; } if (params[categories[i].key] != undefined && params[categories[i].key] != "" && params[categories[i].key] != 'all') { $inputs.eq(0).prop('checked', false); var ary = params[categories[i].key].split("-"); for (var ii = 0; ii < ary.length; ii++) { $('[data-id="' + ary[ii] + '"]').prop('checked', true); if ($('[data-id="' + ary[ii] + '"]').attr('data-set')) { $('[data-set="' + $('[data-id="' + ary[ii] + '"]').attr('data-set') + '"]').eq(0).prop('checked', true); } } } else { $inputs.prop('checked', false); $inputs.eq(0).prop('checked', true); } } set_content(); $leftSearchInputs.each(function () { if ($(this).prop('checked') == true) { $(this).parents('.checkbox_wrap').addClass('is_checked'); } }); $leftSearchInputs.on('change', function () { for(var i = 0; i < categories.length; i++) { var $inputs = $(categories[i].class + ' input'); if($inputs.size() < 1) { continue; } if ($inputs.index(this) != -1) { if ($inputs.index(this) === 0) { $inputs.prop('checked', false); $inputs.eq(0).prop('checked', true); } else { $inputs.eq(0).prop('checked', false); } } } var dataSet = $(this).data('set'); if(dataSet) { var $dataSetElms = $('[data-set="' + dataSet + '"]'); if ($dataSetElms.index(this) === 0) { if ($dataSetElms.eq(0).prop("checked")) { $dataSetElms.prop("checked", true); } else { $dataSetElms.prop("checked", false); } } else if ($dataSetElms.index(this) != -1) { if ($dataSetElms.eq($dataSetElms.index(this)).prop("checked")) { $dataSetElms.eq(0).prop("checked", true); } else { if ($dataSetElms.filter(":checked").length <= 1) { $dataSetElms.eq(0).prop("checked", false); } } } } for(var i = 0; i < categories.length; i++) { var $inputs = $(categories[i].class + ' input'); if($inputs.size() < 1) { continue; } if ($inputs.filter(':checked').length === 0) { $inputs.eq(0).prop("checked", true); } params[categories[i].key] = ''; $inputs.each(function () { if ($(this).prop("checked") && $(this).attr("data-id") != undefined) { if (params[categories[i].key] == "") { params[categories[i].key] += $(this).attr("data-id"); } else { params[categories[i].key] += "-" + $(this).attr("data-id"); } } }); } history.replaceState('', '', setParameter(params)); set_content(); }); } function set_content() { var $listItems = $(".js_listItem"); var $listItems2 = $(".js_listItem2"); var list_on = []; var allClass = []; for(var i = 0; i < categories.length; i++) { var $inputs = $(categories[i].class + ' input'); if($inputs.size() < 1) { continue; } list_on[categories[i].key] = []; $inputs.each(function () { if ($(this).prop("checked") && $(this).attr("data-id")) { list_on[categories[i].key].push($(this).attr("data-id")); } }); allClass[i] = 'on_' + categories[i].key; } var showClass = '.' + allClass.join('.'); $listItems.removeClass(allClass.join(' ')).hide(); $listItems2.addClass('hide'); $listItems.each(function () { for(var i = 0; i < categories.length; i++) { if(typeof list_on[categories[i].key] === 'undefined') { continue; } if (list_on[categories[i].key].length > 0) { var ary = $(this).attr(categories[i].attr).split(","); for (var ii = 0; ii < ary.length; ii++) { if (list_on[categories[i].key].indexOf(ary[ii]) != -1) { $(this).addClass('on_' + categories[i].key); } } } else { if ($(categories[i].class + " input").eq(0).prop("checked")) { $(this).addClass('on_' + categories[i].key); } } } $(showClass).show(); }); /*202209追記*/ $listItems2.each(function () { for(var i = 0; i < categories.length; i++) { if(typeof list_on[categories[i].key] === 'undefined') { continue; } if (list_on[categories[i].key].length > 0) { var ary = $(this).attr(categories[i].attr).split(","); for (var ii = 0; ii < ary.length; ii++) { if (list_on[categories[i].key].indexOf(ary[ii]) != -1) { $(this).removeClass('hide'); } } } else { if ($(categories[i].class + " input").eq(0).prop("checked")) { $(this).removeClass('hide'); } } } $(showClass).show(); }); /*202209追記ここまで*/ $(".js_num").text($(showClass).length); if ($(showClass).length === 0) { $(".no_result").show(); } else { $(".no_result").hide(); } $(".js_state span").hide(); if ($(".js_listItem").length == $(showClass).length) { $(".js_categoryState .all").show(); } else { $(".js_categoryState .refine").show(); } if ($(".js_listItem").length == $(showClass).length) { $(".js_industryState .all").show(); } else { $(".js_industryState .refine").show(); } } function setParameter(paramsArray) { var resurt = location.href.replace(/\?.*$/, ""); for (key in paramsArray) { resurt += (resurt.indexOf('?') == -1) ? '?' : '&'; resurt += key + '=' + paramsArray[key]; } return resurt; } function getParameter() { var paramsArray = []; var url = location.href; parameters = url.split("#"); if (parameters.length > 1) { url = parameters[0]; } parameters = url.split("?"); if (parameters.length > 1) { var params = parameters[1].split("&"); for (i = 0; i < params.length; i++) { var paramItem = params[i].split("="); paramsArray[paramItem[0]] = paramItem[1]; } } return paramsArray; }; $(function(){ $('#sp_menu_btn').on('click', function(){ $('.btn-wrap.ex0').toggleClass('active'); $('#nav').slideToggle(); }); }); $(function(){ $('#sp_menu_btn-2').on('click', function(){ $('.btn-wrap.ex').toggleClass('active'); $('#nav-2').slideToggle(); }); }); $(function(){ $('#sp_menu_btn-3').on('click', function(){ $('.btn-wrap.ex2').toggleClass('active'); $('#nav-3').slideToggle(); }); }); $(function(){ $('#sp_menu_btn-4').on('click', function(){ $('.btn-wrap.ex3').toggleClass('active'); $('#nav-4').slideToggle(); }); }); $(function(){ $('.exmenu-btn').on('click', function(){ $(this).parent('.bMenu__subMenuItem').toggleClass('active'); $(this).next('.bMenu__subMenuplus').slideToggle(); }); }); $(function () { var urlHash = location.hash; if(urlHash){ if (urlHash == '#case_02') { $(".checkbox02").prop("checked", true); } else { $(".checkbox02").prop("checked", false); } }  if(urlHash){ if (urlHash == '#case_03') { $(".checkbox03").prop("checked", true); } else { $(".checkbox03").prop("checked", false); } } }); }); $( window ).scroll(function(){ var scrollHeight = $( window ).scrollTop(); //var section0 = $('.main-box').outerHeight(); var section0 = $('.st-blueBar').outerHeight() + $('.st-siteHeader_2').outerHeight(); if( scrollHeight > section0 ){ $( '.bMenu' ).addClass('fix'); }else{ $( '.bMenu' ).removeClass('fix'); } }); })(BROTHER.lib.$);