//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