//spメニューのエリア選択 $(function () { // ボタンを押下時に遷移 $('#location').click(function () { if ($(this).val() != '') { window.location.href = $('select[name=pullMenu]').val(); } }); }); // slick.js $(function () { $('.pl-slider').slick({ dots: true, // スライダー下部に表示される、ドット状のページネーションです infinite: true, // 無限ループ arrows: true, speed: 300, // 切り替わりのスピード slidesToShow: 2, //通常 1024px以上の領域では4画像表示 slidesToScroll: 2, autoplay: true, autoplaySpeed: 3000, responsive: [{ breakpoint: 1024, settings: {//601px~1024pxでは3画像表示 slidesToShow: 2, slidesToScroll: 2, } }, { breakpoint: 601, settings: {//481px~600pxでは2画像表示 slidesToShow: 1, slidesToScroll: 1 } }, { breakpoint: 480, settings: {//480px以下では1画像表示 slidesToShow: 1, slidesToScroll: 1 } }] }); }); // slick.js エリア検索頁 $(function () { $('.slick-box').slick({ dots: false, arrows: false, autoplay: true, infinite: false, speed: 300, slidesToShow: 2, slidesToScroll: 2, responsive: [ { breakpoint: 1024, settings: { slidesToShow: 2, slidesToScroll: 2, } }, { breakpoint: 600, settings: { slidesToShow: 1, slidesToScroll: 1 } }, { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1 } } ] }); }); // totop.js $(function () { var showTop = 50; $('body').append(''); var fixedTop = $('#fixedTop'); fixedTop.on('click', function () { $('html,body').animate({scrollTop: '0'}, 500); }); $(window).on('load scroll resize', function () { if ($(window).scrollTop() >= showTop) { fixedTop.stop().animate({bottom: '10px'}, 200); } else if ($(window).scrollTop() < showTop) { fixedTop.stop().animate({bottom: '-60px'}, 200); } }); }); // accordion.jp (function ($) { // 読み込んだら開始 $(function () { var accordion = $(".accordion-search"); accordion.each(function () { var noTargetAccordion = $(this).siblings(accordion); $(this).find(".switch").click(function () { $(this).next(".contentWrap").slideToggle(); $(this).toggleClass("open"); noTargetAccordion.find(".contentWrap").slideUp(); noTargetAccordion.find(".switch").removeClass("open"); }); }); }); })(jQuery); // マイページ プロフィール用アコーディオン $(function () { $(".userfilebox dt").on("click", function () { $(this).next().slideToggle(); // activeが存在する場合 if ($(this).children(".userfile_icon").hasClass('active')) { // activeを削除 $(this).children(".userfile_icon").removeClass('active'); } else { // activeを追加 $(this).children(".userfile_icon").addClass('active'); } }); }); $('#tabs li a').click(function (e) { $('#tabs li, #content .current').removeClass('current').removeClass('fadeInLeft'); $(this).parent().addClass('current'); var currentTab = $(this).attr('href'); $(currentTab).addClass('current fadeInLeft'); e.preventDefault(); }); jQuery(function ($) { var windowWidth = $(window).width(); var windowSm = 768; if (windowWidth <= windowSm) { $('.marquee').marquee({ direction: 'left', duration: 4500, delayBeforeStart: 0, }); } else { } }); // footer-accordion.js $(function () { var ac_content = $('.accordion article'); var tap_open = $('.tap-open'); var switchPoint = 768; $(tap_open).on('click', function (e) { if ($(this).hasClass('active')) { $(this).next(ac_content).slideUp(); $(this).removeClass('active'); } else { $(this).next(ac_content).slideDown(); $(this).addClass('active'); } }); // Windowリサイズでアコーディオンの開閉 if ($(window).width() <= switchPoint) { // スマートフォン、タブレットではリサイズイベントが起きない。ios対策(スクロールしただけでリサイズイベントが発生するため) $(window).on('load', function () { moveMainnav(); }); } else { $(window).on('load resize', function () { moveMainnav(); }); } moveMainnav(); function moveMainnav() { if (window.innerWidth < switchPoint) { $(ac_content).hide(); $(tap_open).removeClass('active'); } else { $(ac_content).show(); $(tap_open).addClass('active'); } } }); // hover-image.js //オンマウスでの画像の切り替え// $(function () { $('a img').hover(function () { $(this).attr('src', $(this).attr('src').replace('_off', '_on')); }, function () { $(this).attr('src', $(this).attr('src').replace('_on', '_off')); }); }); // js-tab.js $(function () { $(".tab li").click(function () { var num = $(".tab li").index(this); $(".tabContent").removeClass('active'); $(".tabContent").eq(num).addClass('active'); $(".tab li").removeClass('active'); $(this).addClass('active') }); }); // modal.js $(function () { // 「.modal-open」をクリック $('.modal-open').click(function () { // オーバーレイ用の要素を追加 $('body').append(''); // オーバーレイをフェードイン $('.modal-overlay').fadeIn('slow'); // モーダルコンテンツのIDを取得 var modal = '#' + $(this).attr('data-target'); // モーダルコンテンツのclassを取得 if ($(this).attr('data-target-class')) { modal = '.' + $(this).attr('data-target-class'); } // モーダルコンテンツの表示位置を設定 modalResize(); // モーダルコンテンツフェードイン $(modal).fadeIn('slow'); // 「.modal-overlay」あるいは「.modal-close」をクリック $('.modal-overlay, .modal-close').off().click(function () { // モーダルコンテンツとオーバーレイをフェードアウト $(modal).fadeOut('slow'); $('.modal-overlay').fadeOut('slow', function () { // オーバーレイを削除 $('.modal-overlay').remove(); }); }); // リサイズしたら表示位置を再取得 $(window).on('resize', function () { modalResize(); }); // モーダルコンテンツの表示位置を設定する関数 function modalResize() { // ウィンドウの横幅、高さを取得 var w = $(window).width(); var h = $(window).height(); // モーダルコンテンツの表示位置を取得 var x = (w - $(modal).outerWidth(true)) / 2; var y = (h - $(modal).outerHeight(true)) / 2; // モーダルコンテンツの表示位置を設定 $(modal).css({'left': x + 'px', 'top': y + 'px'}); } }); }); // show-pass.js $('#toggle-password').on("click", function () { var $password = $('#input-pass,#input-pass-re'); if ($password.prop('type') == 'password') { $password.prop('type', 'text'); } else { $password.prop('type', 'password'); } $(this).find('span').toggleClass('hide'); }); // side-fix.js // ページの読み込みが完了してから実行 $(function () { // 途中から固定したいボックスの情報を得る var navBox = $("#fixedNavi,#userNavi"); if (navBox.length) { var navOst = navBox.offset().top; // スクロールされた際に実行 $(window).scroll(function () { // 現在のスクロール位置と、固定したいボックスの位置を比較 if ($(window).scrollTop() > navOst) { // 固定用のclassを付加 navBox.addClass("fixBox"); } else { // 固定用のclassを削除 navBox.removeClass("fixBox"); } }); } }); $(function () { // ショップサイドバーで使用 if ($('#shop_sidefix').length) { var target = $("#shop_sidefix"); var footer = $("#footer") var targetHeight = target.outerHeight(true); var targetTop = target.offset().top; $(window).scroll(function () { var scrollTop = $(this).scrollTop(); if (scrollTop > targetTop) { var footerTop = footer.offset().top; if (scrollTop + targetHeight > footerTop) { customTopPosition = footerTop - (scrollTop + targetHeight) target.css({position: "fixed", top: customTopPosition + "px"}); } else { target.css({position: "fixed", top: "10px"}); } } else { target.css({position: "static", top: "auto"}); } }); } }); // sp-menu.js $(function () { $("#menuButton").click(function () { $(this).toggleClass("active"); //メニューボタンの切り替え /*-- メニューの開閉 --*/ if ($(this).hasClass("active")) { $("body").css("oveflow", "hidden"); $("main").animate({ "left": "-20%" }, 400); $("aside") .show() .animate({ "left": "20%" }, 400); } else { $("main").animate({ "left": 0 }, 400); $("aside") .show() .animate({ "left": "100%" }, 400, function () { $("aside").hide(); $("body").css("oveflow", "visuble"); }); } return false; }); }); // sp-tap.js (function () { var tapClass = ""; var hoverClass = ""; var Hover = window.Hover = function (ele) { return new Hover.fn.init(ele); }; Hover.fn = { //Hover Instance init: function (ele) { this.prop = ele; } , bind: function (_hoverClass, _tapClass) { hoverClass = _hoverClass; tapClass = _tapClass; $(window).bind("touchstart", function (event) { var target = event.target || window.target; var bindElement = null; if (target.tagName == "A" || $(target).hasClass(tapClass)) { bindElement = $(target); } else if ($(target).parents("a").length > 0) { bindElement = $(target).parents("a"); } else if ($(target).parents("." + tapClass).length > 0) { bindElement = $(target).parents("." + tapClass); } if (bindElement != null) { Hover().touchstartHoverElement(bindElement); } }); } , touchstartHoverElement: function (bindElement) { bindElement.addClass(hoverClass); bindElement.unbind("touchmove", Hover().touchmoveHoverElement); bindElement.bind("touchmove", Hover().touchmoveHoverElement); bindElement.unbind("touchend", Hover().touchendHoverElement); bindElement.bind("touchend", Hover().touchendHoverElement); } , touchmoveHoverElement: function (event) { $(this).removeClass(hoverClass); } , touchendHoverElement: function (event) { $(this).removeClass(hoverClass); } } Hover.fn.init.prototype = Hover.fn; Hover().bind("hover", "tap"); } )(); // swiper.js $(function () { var mySwiper = $('.swiper-container').swiper({ //Your options here: pagination: '.pagination', loop: true, autoplay: 3000, paginationClickable: true, calculateHeight: true, touchRatio: 0.6, speed: 600, }); }); //チェックボックスをチェックすると、「掲載申し込み画面へ」ボタンがactiveになる// $(function () { $('#submit').prop('disabled', true); $('#check').on('click', function () { if ($(this).prop('checked') == false) { $('#submit').prop('disabled', true); } else { $('#submit').prop('disabled', false); } }); }); $(document).ready(function () { $('a[href^="#"]').on('click', function (e) { e.preventDefault(); var target = this.hash; var $target = $(target); $('html, body').stop().animate({ 'scrollTop': $target.offset().top }, 600, 'swing', function () { window.location.hash = target; }); }); }); // Easy Responsive Tabs Plugin // Author: Samson.Onna (function ($) { $.fn.extend({ easyResponsiveTabs: function (options) { //Set the default values, use comma to separate the settings, example: var defaults = { type: 'default', //default, vertical, accordion; width: 'auto', fit: true, closed: false, tabidentify: '', activetab_bg: 'white', inactive_bg: '#F5F5F5', active_border_color: '#c1c1c1', active_content_border_color: '#c1c1c1', activate: function () { } } //Variables var options = $.extend(defaults, options); var opt = options, jtype = opt.type, jfit = opt.fit, jwidth = opt.width, vtabs = 'vertical', accord = 'accordion'; var hash = window.location.hash; var historyApi = !!(window.history && history.replaceState); //Events $(this).bind('tabactivate', function (e, currentTab) { if (typeof options.activate === 'function') { options.activate.call(currentTab, e) } }); //Main function this.each(function () { var $respTabs = $(this); var $respTabsList = $respTabs.find('ul.resp-tabs-list.' + options.tabidentify); var respTabsId = $respTabs.attr('id'); $respTabs.find('ul.resp-tabs-list.' + options.tabidentify + ' li').addClass('resp-tab-item').addClass(options.tabidentify); $respTabs.css({ 'display': 'block', 'width': jwidth }); if (options.type == 'vertical') $respTabsList.css('margin-top', '3px'); $respTabs.find('.resp-tabs-container.' + options.tabidentify).css('border-color', options.active_content_border_color); $respTabs.find('.resp-tabs-container.' + options.tabidentify + ' > div').addClass('resp-tab-content').addClass(options.tabidentify); jtab_options(); //Properties Function function jtab_options() { if (jtype == vtabs) { $respTabs.addClass('resp-vtabs').addClass(options.tabidentify); } if (jfit == true) { $respTabs.css({width: '100%', margin: '0px'}); } if (jtype == accord) { $respTabs.addClass('resp-easy-accordion').addClass(options.tabidentify); $respTabs.find('.resp-tabs-list').css('display', 'none'); } } //Assigning the h2 markup to accordion title var $tabItemh2; $respTabs.find('.resp-tab-content.' + options.tabidentify).before(""); $respTabs.find('.resp-tab-content.' + options.tabidentify).prev("h2").css({ 'background-color': options.inactive_bg, 'border-color': options.active_border_color }); var itemCount = 0; $respTabs.find('.resp-accordion').each(function () { $tabItemh2 = $(this); var $tabItem = $respTabs.find('.resp-tab-item:eq(' + itemCount + ')'); var $accItem = $respTabs.find('.resp-accordion:eq(' + itemCount + ')'); $accItem.append($tabItem.html()); $accItem.data($tabItem.data()); $tabItemh2.attr('aria-controls', options.tabidentify + '_tab_item-' + (itemCount)); itemCount++; }); //Assigning the 'aria-controls' to Tab items var count = 0, $tabContent; $respTabs.find('.resp-tab-item').each(function () { $tabItem = $(this); $tabItem.attr('aria-controls', options.tabidentify + '_tab_item-' + (count)); $tabItem.attr('role', 'tab'); $tabItem.css({ 'background-color': options.inactive_bg, 'border-color': 'none' }); //Assigning the 'aria-labelledby' attr to tab-content var tabcount = 0; $respTabs.find('.resp-tab-content.' + options.tabidentify).each(function () { $tabContent = $(this); $tabContent.attr('aria-labelledby', options.tabidentify + '_tab_item-' + (tabcount)).css({ 'border-color': options.active_border_color }); tabcount++; }); count++; }); // Show correct content area var tabNum = 0; if (hash != '') { var matches = hash.match(new RegExp(respTabsId + "([0-9]+)")); if (matches !== null && matches.length === 2) { tabNum = parseInt(matches[1], 10) - 1; if (tabNum > count) { tabNum = 0; } } } //Active correct tab $($respTabs.find('.resp-tab-item.' + options.tabidentify)[tabNum]).addClass('resp-tab-active').css({ 'background-color': options.activetab_bg, 'border-color': options.active_border_color }); //keep closed if option = 'closed' or option is 'accordion' and the element is in accordion mode if (options.closed !== true && !(options.closed === 'accordion' && !$respTabsList.is(':visible')) && !(options.closed === 'tabs' && $respTabsList.is(':visible'))) { $($respTabs.find('.resp-accordion.' + options.tabidentify)[tabNum]).addClass('resp-tab-active').css({ 'background-color': options.activetab_bg + ' !important', 'border-color': options.active_border_color, 'background': 'none' }); $($respTabs.find('.resp-tab-content.' + options.tabidentify)[tabNum]).addClass('resp-tab-content-active').addClass(options.tabidentify).attr('style', 'display:block'); } //assign proper classes for when tabs mode is activated before making a selection in accordion mode else { // $($respTabs.find('.resp-tab-content.' + options.tabidentify)[tabNum]).addClass('resp-accordion-closed'); //removed resp-tab-content-active } //Tab Click action function $respTabs.find("[role=tab]").each(function () { var $currentTab = $(this); $currentTab.click(function () { var $currentTab = $(this); var $tabAria = $currentTab.attr('aria-controls'); if ($currentTab.hasClass('resp-accordion') && $currentTab.hasClass('resp-tab-active')) { $respTabs.find('.resp-tab-content-active.' + options.tabidentify).slideUp('', function () { $(this).addClass('resp-accordion-closed'); }); $currentTab.removeClass('resp-tab-active').css({ 'background-color': options.inactive_bg, 'border-color': 'none' }); return false; } if (!$currentTab.hasClass('resp-tab-active') && $currentTab.hasClass('resp-accordion')) { $respTabs.find('.resp-tab-active.' + options.tabidentify).removeClass('resp-tab-active').css({ 'background-color': options.inactive_bg, 'border-color': 'none' }); $respTabs.find('.resp-tab-content-active.' + options.tabidentify).slideUp().removeClass('resp-tab-content-active resp-accordion-closed'); $respTabs.find("[aria-controls=" + $tabAria + "]").addClass('resp-tab-active').css({ 'background-color': options.activetab_bg, 'border-color': options.active_border_color }); $respTabs.find('.resp-tab-content[aria-labelledby = ' + $tabAria + '].' + options.tabidentify).slideDown().addClass('resp-tab-content-active'); } else { console.log('here'); $respTabs.find('.resp-tab-active.' + options.tabidentify).removeClass('resp-tab-active').css({ 'background-color': options.inactive_bg, 'border-color': 'none' }); $respTabs.find('.resp-tab-content-active.' + options.tabidentify).removeAttr('style').removeClass('resp-tab-content-active').removeClass('resp-accordion-closed'); $respTabs.find("[aria-controls=" + $tabAria + "]").addClass('resp-tab-active').css({ 'background-color': options.activetab_bg, 'border-color': options.active_border_color }); $respTabs.find('.resp-tab-content[aria-labelledby = ' + $tabAria + '].' + options.tabidentify).addClass('resp-tab-content-active').attr('style', 'display:block'); } //Trigger tab activation event $currentTab.trigger('tabactivate', $currentTab); //Update Browser History if (historyApi) { var currentHash = window.location.hash; var tabAriaParts = $tabAria.split('tab_item-'); // var newHash = respTabsId + (parseInt($tabAria.substring(9), 10) + 1).toString(); var newHash = respTabsId + (parseInt(tabAriaParts[1], 10) + 1).toString(); if (currentHash != "") { var re = new RegExp(respTabsId + "[0-9]+"); if (currentHash.match(re) != null) { newHash = currentHash.replace(re, newHash); } else { newHash = currentHash + "|" + newHash; } } else { newHash = '#' + newHash; } history.replaceState(null, null, newHash); } }); }); //Window resize function $(window).resize(function () { $respTabs.find('.resp-accordion-closed').removeAttr('style'); }); }); } }); })(jQuery); $(document).ready(function () { //Horizontal Tab $('#parentHorizontalTab').easyResponsiveTabs({ type: 'default', //Types: default, vertical, accordion width: 'auto', //auto or any width like 600px fit: true, // 100% fit in a container tabidentify: 'hor_1', // The tab groups identifier activate: function (event) { // Callback function if tab is switched var $tab = $(this); var $info = $('#nested-tabInfo'); var $name = $('span', $info); $name.text($tab.text()); $info.show(); } }); // Child Tab $('#ChildVerticalTab_1').easyResponsiveTabs({ type: 'vertical', width: 'auto', fit: true, tabidentify: 'ver_1', // The tab groups identifier activetab_bg: '#fff', // background color for active tabs in this group inactive_bg: '#F5F5F5', // background color for inactive tabs in this group active_border_color: '#c1c1c1', // border color for active tabs heads in this group active_content_border_color: '#5AB1D0' // border color for active tabs contect in this group so that it matches the tab head border }); //Vertical Tab $('#parentVerticalTab').easyResponsiveTabs({ type: 'vertical', //Types: default, vertical, accordion width: 'auto', //auto or any width like 600px fit: true, // 100% fit in a container closed: 'accordion', // Start closed if in accordion view tabidentify: 'hor_1', // The tab groups identifier activate: function (event) { // Callback function if tab is switched var $tab = $(this); var $info = $('#nested-tabInfo2'); var $name = $('span', $info); $name.text($tab.text()); $info.show(); } }); });