// indexページ 新着情報自動スクロール $(".id-1").scroller('{"amount" : 80, "delay" : 5000 }'); // indexページ Swiper var swiper = new Swiper(".swiper", { loop: true, spaceBetween: 10, slidesPerView: 4, freeMode: true, watchSlidesProgress: true, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, pagination: { el: '.swiper-pagination', type: 'bullets', clickable: true, }, thumbs: { swiper: swiper, }, }); // PCメニューの上部固定(indexのみ) $(function () { // 右カラム固定用 if ($('#shop-ad').length) { var target = $("#shop-ad"); var footer = $("#site-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: "45px", width: "245px" }); } } else { target.css({ position: "static", top: "auto" }); } }); } }); // PCメニューの上部固定 $(function () { let target = $("#page-nav").offset().top; $(window).on("scroll", function () { let currentPos = $(window).scrollTop(); if (currentPos > target) { $(".page-nav").addClass('adfixed'); } else { $(".page-nav").removeClass('adfixed'); } }); }); // indexページ右カラムの上部固定 $(function () { // 右カラム固定用 if ($('#shop-ad').length) { var target = $("#shop-ad"); var footer = $("#site-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: "50px", width: "245px"}); } } else { target.css({position: "static", top: "auto"}); } }); } });