$(function () { var lh = ""; lh = location.href; if (lh.match(/dcmsadm/)) { } else { // ------------------------------------------------------------------------- // swiper slide 01 --------------------------------------------------------- var swiper_01 = new Swiper(".dlb_slide-01", { // Optional parameters loop: true, // Auto play autoplay: { delay: 3000, disableOnInteraction: false, }, // Default parameters slidesPerView: 1, spaceBetween: 0, // Responsive breakpoints breakpoints: { // when window width is >= 576px 576: { slidesPerView: 2, }, // when window width is >= 768px 768: { slidesPerView: 3, }, }, }); // end swiper slide 01 ----------------------------------------------------- // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- // swiper slide 02 --------------------------------------------------------- var swiper_02_thumb = new Swiper(".dlb_slide-02-thumb", { // Optional parameters loop: false, // Default parameters slidesPerView: 3, spaceBetween: 8, // Responsive breakpoints breakpoints: { // when window width is >= 320px 320: { slidesPerView: 3, }, // when window width is >= 768px 768: { slidesPerView: 6, }, }, }); var swiper_02 = new Swiper(".dlb_slide-02", { // Optional parameters loop: true, // Auto play autoplay: { delay: 3000, disableOnInteraction: false, }, effect: "fade", // Default parameters slidesPerView: 1, spaceBetween: 0, thumbs: { swiper: swiper_02_thumb, }, }); // end swiper slide 02 ----------------------------------------------------- // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- // swiper slide 03 --------------------------------------------------------- var swiper_03 = new Swiper(".dlb_slide-03", { // Optional parameters loop: true, // Auto play autoplay: { delay: 3000, disableOnInteraction: false, }, // Default parameters slidesPerView: 1, spaceBetween: 0, // Responsive breakpoints breakpoints: { // when window width is >= 320px 320: { slidesPerView: 1, }, // when window width is >= 768px 768: { slidesPerView: 2, }, // when window width is >= 1024px 1024: { slidesPerView: 4, }, }, // Navigation arrows navigation: { nextEl: ".dlb_slide-03-next", prevEl: ".dlb_slide-03-prev", }, }); // end swiper slide 03 ----------------------------------------------------- // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- // swiper slide 04 --------------------------------------------------------- var swiper_04_thumb = new Swiper(".dlb_slide-04-thumb", { // Optional parameters loop: false, // Default parameters slidesPerView: 5, spaceBetween: 8, }); var swiper_04 = new Swiper(".dlb_slide-04", { // Optional parameters loop: true, // Auto play autoplay: { delay: 3000, disableOnInteraction: false, }, effect: "fade", // Default parameters slidesPerView: 1, spaceBetween: 0, thumbs: { swiper: swiper_04_thumb, }, }); // end swiper slide 04 ----------------------------------------------------- // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- // swiper slide 05 --------------------------------------------------------- var swiper_05 = new Swiper(".dlb_slide-05", { // Optional parameters loop: true, // Auto play autoplay: { delay: 5000, disableOnInteraction: false, }, // Default parameters slidesPerView: 1, spaceBetween: 0, // Responsive breakpoints breakpoints: { // when window width is >= 320px 320: { slidesPerView: 1, spaceBetween: 0, }, // when window width is >= 768px 768: { slidesPerView: 2, spaceBetween: 0, }, }, // Navigation arrows navigation: { nextEl: ".dlb_slide-05-next", prevEl: ".dlb_slide-05-prev", }, }); // end swiper slide 05 ----------------------------------------------------- // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- // swiper blog 01 ---------------------------------------------------------- var swiper_blog_01 = new Swiper(".dlb_blog-01", { // Optional parameters loop: true, // Auto play autoplay: { delay: 3000, disableOnInteraction: false, }, // Default parameters slidesPerView: 1, spaceBetween: 0, // Responsive breakpoints breakpoints: { // when window width is >= 320px 320: { slidesPerView: 1, }, // when window width is >= 768px 768: { slidesPerView: 2, }, // when window width is >= 1024px 1024: { slidesPerView: 4, }, }, // Navigation arrows navigation: { nextEl: ".blog_01-next", prevEl: ".blog_01-prev", }, }); // swiper blog 01 ---------------------------------------------------------- // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- // js-slide-blog01 --------------------------------------------------------- function setSlider(slider, setName){ // スライド動作の条件(最低枚数) // スマホ if ($(window).width() <= 768) { var createSlideCond = 1; // タブレット } else if ($(window).width() <= 1024) { var createSlideCond = 2; // PC } else { var createSlideCond = 4; } var count = 1; $(slider).each(function(){ // スライダーとページャーにidを付与 var sliderId = setName + count; var sliderNextId = setName + "-next" + count; var sliderPrevId = setName + "-prev" + count; $(this).attr("id", sliderId); $(this).find(".js-blog_01-next").attr("id", sliderNextId); $(this).find(".js-blog_01-prev").attr("id", sliderPrevId); // スライドの枚数をカウント var slideCount = $("#" + sliderId + " .swiper-slide").length; // スライドの枚数が最低枚数より多い場合はスライダーを動作させる if (slideCount > createSlideCond) { $("#" + sliderNextId + ", #" + sliderPrevId).show(); $("#" + sliderId).removeClass("is-noslide"); var dlb_slide_blog_01 = new Swiper("#" + sliderId + " .swiper-container", { slidesPerView: 1, speed: 500, grabCursor: true, loop: true, autoplay: true, breakpoints: { 320: { slidesPerView: 1, }, 768: { slidesPerView: 2, }, 1024: { slidesPerView: 4, }, }, navigation: { nextEl: "#" + sliderNextId, prevEl: "#" + sliderPrevId, }, }); // スライドの枚数が最低枚数より少ない場合はページャーを非表示にし、slide無効用クラスを付与する } else { $("#" + sliderNextId + ", #" + sliderPrevId).hide(); $("#" + sliderId).addClass("is-noslide"); } count++; }); } $(window).on("load resize", function(){ setSlider(".js-slide-blog01", "blog-slide"); }); // js-slide-blog01 ----------------------------------------------------- // ------------------------------------------------------------------------- // スムーズスクロール $('a[href^="#"]') .not(".nav a, .carousel-control-prev a, .carousel-control-next a") .on("click", function () { var speed = 300; // ミリ秒 var href = $(this).attr("href"); var target = $(href == "#" || href == "" ? "html" : href); var position = target.offset().top; var height = $(".bs_header-01").height() + 24; $("body,html").animate({ scrollTop: position - height }, speed, "swing"); return false; }); // location.hash $(window).on("load", function () { var urlHash = location.hash; if (urlHash) { var position = $("body").find(urlHash).offset().top; var height = $(".bs_header-01").height() + 24; var anchorLink = position - height; $("body,html").scrollTop(anchorLink); return false; } }); // navbar閉じる $(".bm_navbar a").on("click", function () { $(".bm_navbar-toggle").collapse("hide"); }); // js_copy-hash $(".js_copy-hash").on("click", function () { // dataを取得 var copyText = $(this).data("hash"); var alertTarget = $(this).data("alert"); // クリップボードへ navigator.clipboard.writeText(copyText); // アラートを出す $("." + alertTarget) .fadeIn(300) .delay(2000) .fadeOut(400); }); $(".js_readmore").on("click", function () { $(this).hide(); $(".js_open").slideDown(); $(".js_morelink").fadeIn(); }); // slider siema // lp if ($(".bm_slider").length) { var mySiema = new Siema({ selector: ".bm_slider", perPage: { 320: 1.5, 576: 2.6, 768: 3.7, }, duration: 300, }); } // tel if (navigator.userAgent.match(/(iPhone|iPad|iPod|Android)/)) { $(".tel").each(function () { var str = $(this).html(); if ($(this).children().is("img")) { $(this).html( $("") .attr("href", "tel:" + $(this).children().attr("alt").replace(/-/g, "")) .append(str + "") ); } else { $(this).html( $("") .attr("href", "tel:" + $(this).text().replace(/-/g, "")) .append(str + "") ); } }); } // matchHeightの修正の際に不要になった高さ合わせ // flowの高さ合わせ if ($(".dlb_flow-1").length) { $(".dlb_flow-1 .dlb_flow-title").matchHeight(); } // bs02の高さ合わせ if ($(".bs_footer-02 .bs_footer-contact").length) { $(".bs_footer_contact-title").matchHeight(); } // bs03の高さ合わせ if ($(".bs_footer-03 .bs_footer-contact").length) { $(".bs_footer-btn").matchHeight(); } // matchHeight if ($(".js-matchHeight").find(".js-matchHeight-middle").length) { $(".js-matchHeight-middle").matchHeight(); } if ($(".js-matchHeight").find(".js-matchHeight-top").length) { $(".js-matchHeight-top").matchHeight(); } // footer fix if ($(".dlb_footer-fixed").length) { var fadeIn = $(".dlb_footer-fixed"); $(window).on("scroll", function () { $(fadeIn).each(function () { var scroll = $(window).scrollTop(); var windowHeight = $(window).height(); var documentHeight = $(document).outerHeight(); var footerHeight = $("#footer-01").outerHeight(); if (scroll < windowHeight / 2) { $(this).removeClass("scroll-in"); } else if (scroll > windowHeight / 2 && scroll < documentHeight - windowHeight - footerHeight) { $(this).addClass("scroll-in").removeClass("scroll-stop"); } else if (scroll < documentHeight - footerHeight) { $(this).addClass("scroll-stop"); } }); }); } // top-link if ($(".share_top-link").length) { var fadeIn_topLink = $(".share_top-link .top-link"); $(window).on("scroll", function () { $(fadeIn_topLink).each(function () { var scroll = $(window).scrollTop(); var windowHeight = $(window).height(); var documentHeight = $(document).outerHeight(); var footerHeight = $("#footer-01").outerHeight(); if (scroll < windowHeight / 2) { $(this).fadeOut(300); } else if (scroll > windowHeight / 2 && scroll < documentHeight - windowHeight - footerHeight) { $(this).fadeIn(300); } }); }); } // ie スムーズスクロール解除 if (navigator.userAgent.match(/MSIE 10/i) || navigator.userAgent.match(/Trident\/7\./)) { // マウスホイールでのスクロール時 $("body").on("mousewheel", function () { // デフォルトの設定値をOFFに切り替える event.preventDefault(); var wd = event.wheelDelta; var csp = window.pageYOffset; window.scrollTo(0, csp - wd); }); } } });