1// JavaScript Document 2 3jQuery(document).ready(function () { 4 $("#keyvsl").css("opacity", "1"); 5 6 //ã¦ã£ã³ãã¦ãµã¤ãºå¤æ´å¯¾å¿ 7$(window).on("load resize", function () { 8 const isUnder48em = window.matchMedia("(max-width: 47.999em)").matches; 9 const isIpad = /iPad|Macintosh/.test(navigator.userAgent) && 'ontouchend' in document; 10 const isSmartphone = isUnder48em && !isIpad; 11 12 // === 䏿¦ãªã»ãã === 13 $("#nav").removeClass("open sp_nav"); 14 $("#menu .fixed_menu_btn").removeClass("active"); 15 $(".sub").removeClass("close"); 16 $(".subnav").stop(true, true).hide(); // ã¢ãã¡ã¼ã·ã§ã³ä¸æ¢ãã¦å³æé表示 17 $(".overlay").removeClass("open"); 18 $("body").css("overflow", "auto"); 19 $("#nav").css("display", ""); // ãããã¯ã»é表示ãªã©ã¯CSSã«ä»»ãã 20 21 // === ç¶æ é©ç¨ === 22 if (isSmartphone) { 23 $("#nav").addClass("sp_nav").css("transition", "all 0.8s"); 24 } else { 25 $("#nav").css("transition", "0"); 26 } 27}); 28 29// SPã¡ãã¥ã¼ 30let isAnimating = false; 31const transitionDuration = 500; // ãã©ã³ã¸ã·ã§ã³æé 32 33function closeSpMenu() { 34 if (isAnimating) return; 35 isAnimating = true; 36 37 $(".fixed_menu_btn").removeClass("active"); 38 $("#nav").removeClass("open"); 39 $(".overlay").removeClass("open"); 40 $("body").css("overflow", "auto"); 41 42 setTimeout(function () { 43 $("#nav").css("display", "none"); 44 isAnimating = false; 45 }, transitionDuration); 46} 47 48$("#menu .fixed_menu_btn").on("click", function () { 49 if (isAnimating) return; 50 51 if ($(this).hasClass("active")) { 52 // éãã 53 closeSpMenu(); 54 } else { 55 // éã 56 isAnimating = true; 57 $(this).addClass("active"); 58 $("#nav").css("display", "block"); 59 60 setTimeout(function () { 61 $("#nav").addClass("open"); 62 $(".overlay").addClass("open"); 63 $("body").css("overflow", "hidden"); 64 isAnimating = false; 65 }, 10); 66 } 67}); 68 69$(".overlay").on("click", function () { 70 closeSpMenu(); 71}); 72 73$("#nav a").on("click", function () { 74 if ($("#nav").hasClass("sp_nav")) { 75 closeSpMenu(); 76 } 77}); 78 79 //PCã°ãã¼ãã«ã¡ãã¥ã¼åºå® 80 $(window).on("load orientationchange", function () { 81 var windowWidth = $(window).width(); 82 var windowSm = 768; 83 if (windowWidth >= windowSm) { 84 // pcã®å ´å 85 var navPos = $("#nav").offset().top; // ã°ãã¼ãã«ã¡ãã¥ã¼ã®ä½ç½® 86 87 $(window).on("scroll load", function () { 88 if ($(this).scrollTop() > navPos) { 89 $("#nav").addClass("fixed", 1000); 90 } else { 91 $("#nav").removeClass("fixed"); 92 } 93 94 const element = document.querySelector("#nav"); 95 window.addEventListener("scroll", () => { 96 element.style.left = -window.pageXOffset + "px"; 97 }); 98 }); 99 } 100 }); 101 102 // é»è©±çªå· 103 if (navigator.userAgent.match(/(iPhone|iPad|Android|Mobile)/)) { 104 $(".js-tel").each(function () { 105 var str = $(this).html(); 106 if ($(this).children().is("img")) { 107 $(this).html( 108 $("<a>") 109 .attr( 110 "href", 111 "tel:" + $(this).children().attr("alt").replace(/-/g, "") 112 ) 113 .append(str + "</a>") 114 ); 115 } else { 116 $(this).html( 117 $("<a>") 118 .attr("href", "tel:" + $(this).text().replace(/-/g, "")) 119 .append(str + "</a>") 120 ); 121 } 122 }); 123 } 124 125 // ãããããã¼ãã¸ã¥ã¢ã«èæ¯ 126 $("#keyvsl").slick({ 127 autoplay: true, // èªååç 128 autoplaySpeed: 4000, // åçééï¼ããªç§ï¼ 129 speed: 2000, // ãã§ã¼ãé度 130 fade: true, // ãã§ã¼ãã¤ã³/ã¢ã¦ã 131 infinite: true, // ç¡éã«ã¼ã 132 arrows: false, // ç¢å°ãé表示 133 dots: false, // ãããããã²ã¼ã·ã§ã³ãé表示 134 pauseOnHover: false, // ããã¼æã«ä¸æåæ¢ããªã 135 pauseOnFocus: false, // ãã©ã¼ã«ã¹æã«ä¸æåæ¢ããªã 136 }); 137 138 //ã«ã¬ã³ãã¼ã¿ã 139 // æåã®ã¿ããã¢ã¯ãã£ãã«ãã 140 $(".tab:first").addClass("active"); 141 $("#tab1").addClass("active"); 142 143 // ã¿ããã¯ãªãã¯ãããã¨ãã®å¦ç 144 $(".tab").click(function () { 145 // ãã¹ã¦ã®ã¿ããéã¢ã¯ãã£ãã«ããã¯ãªãã¯ãããã¿ããã¢ã¯ãã£ãã«ãã 146 $(".tab").removeClass("active"); 147 $(this).addClass("active"); 148 149 // ãã¹ã¦ã®ã³ã³ãã³ããé表示ã«ããã¯ãªãã¯ãããã¿ãã«å¯¾å¿ããã³ã³ãã³ãã表示ãã 150 $(".tab-content").removeClass("active"); 151 $("#" + $(this).data("tab")).addClass("active"); 152 }); 153 154 // ãããããç¥ãããã¢ã³ã¼ãã£ãªã³ 155 // DOM夿´ãç£è¦ããå ±é颿° 156function watchDOM(selector, callback) { 157 const observer = new MutationObserver(() => { 158 callback(); // æå®ãããå¦çãå®è¡ 159 }); 160 161 const container = $(selector)[0]; 162 163 if (container) { 164 observer.observe(container, { 165 childList: true, // åè¦ç´ ã®è¿½å ã»åé¤ãç£è¦ 166 subtree: true // å«è¦ç´ 以ä¸ã®å¤æ´ãç£è¦ 167 });
168 } 169} 170function initAccordion() { 171 // æåã®3ã¤ãéã 172 $('.accordion-item').each(function(index) { 173 if (index < 3) { 174 $(this).prop('open', true).addClass('open'); 175 } 176 }); 177 178 // ã¯ãªãã¯ã¤ãã³ãè¨å®ï¼éè¤ç»é²ãé²ãï¼ 179 $('.accordion-item').off('toggle.accordion').on('toggle.accordion', function() { 180 $(this).toggleClass('open', this.open); 181 }); 182} 183 184// é©ç¨ 185$(function() { 186 initAccordion(); // ååç¨ 187 watchDOM('[data-styled]', initAccordion); // Vueã§çæãããHTMLã«ãå¯¾å¿ 188}); 189 190//æé表ã¢ã³ã¼ãã£ãªã³ 191 $(".tbl-switch").click(function () { 192 $(this).toggleClass("open").next("div").slideToggle(); 193 }); 194 195 // ã¯ãªããã¯ç´¹ä»ã®ã£ã©ãªã¼ 196 function setupSlider(mainSliderID, thumbnailSliderID) { 197 const slidesToShow = $(thumbnailSliderID).data("slides") || 4; // `data-slides`ããåå¾ï¼ããã©ã«ã4ï¼ 198 //< id="thumbnail_slider01" data-slides="5">ã®ããã«è¨å®ãã 199 $(mainSliderID).slick({ 200 autoplay: false, 201 infinite: false, 202 speed: 600, 203 arrows: false, 204 asNavFor: thumbnailSliderID, 205 }); 206 207 $(thumbnailSliderID).slick({ 208 slidesToShow: slidesToShow, 209 infinite: false, 210 speed: 600, 211 asNavFor: mainSliderID, 212 }); 213 214 $(thumbnailSliderID + " .slick-slide").on("click", function () { 215 var index = $(this).attr("data-slick-index"); 216 $(thumbnailSliderID).slick("slickGoTo", index, false); 217 }); 218 } 219 220 // IDã«æ³åæ§ãæããã¦ã¹ã©ã¤ãã¼ãè¨å® 221 var i = 1; 222 while ($("#slider" + ("0" + i).slice(-2)).length) { 223 var mainSliderID = "#slider" + ("0" + i).slice(-2); 224 var thumbnailSliderID = "#thumbnail_slider" + ("0" + i).slice(-2); 225 setupSlider(mainSliderID, thumbnailSliderID); 226 i++; 227 } 228 229 // PC 診çå 容ãããããã¦ã³ã¡ãã¥ã¼ 230 function setupNavDropdown() { 231 const windowWidth = $(window).width(); 232 const windowSm = 768; 233 234 $(".sub").off("click"); // ã¾ãæ¢åã¤ãã³ããåé¤ï¼éè¤é²æ¢ï¼ 235 236 if (windowWidth >= windowSm) { 237 // PCã®å ´å 238 $("#nav .subnav").hide(); 239 $("#nav .sub").on("click", function (e) { 240 e.stopPropagation(); // 親ã¸ã®ä¼æãæ¢ãã 241 $(this) 242 .toggleClass("close") 243 .next(".subnav") 244 .css("visibility", "visible") 245 .slideToggle(); 246 247 $("#nav .sub") 248 .not($(this)) 249 .removeClass("close") 250 .next(".subnav") 251 .hide(); 252 253 return false; 254 }); 255 256 $(window).on("click.navClose", function () { 257 if ($("#nav .subnav").is(":visible")) { 258 $("#nav .sub").removeClass("close"); 259 $("#nav .subnav").hide(); 260 } 261 }); 262 } else { 263 // ã¹ããç¨ 264 $("#nav .sub").on("click", function () { 265 $(this).toggleClass("close").next(".subnav").slideToggle(); 266 }); 267 268 $(window).off("click.navClose"); // PCç¨ã¯ãªãã¯éããç¡å¹ã« 269 } 270} 271 272// åæå & ãªãµã¤ãºå¯¾å¿ 273$(function () { 274 setupNavDropdown(); 275 $(window).on("resize", setupNavDropdown); 276}); 277 278 //ã¢ã¼ãã«ã¦ã£ã³ã㦠279 // Show Modal 280 $(".modal-trigger").on("click", function (e) { 281 e.preventDefault(); 282 var target = $(this).data("target"); 283 var $modal = $("#" + target); 284 285 // ã¢ã¼ãã«ã¨èæ¯ã表示 286 $modal.fadeIn(); 287 288 // ä»ã®è¦ç´ ãæä½ä¸å¯ã«ãã 289 $("body").css("overflow", "hidden"); // ã¹ã¯ãã¼ã«ãç¡å¹å 290 $("*").not($modal).css("pointer-events", "none"); // ã¢ã¼ãã«ä»¥å¤ã®è¦ç´ ãæä½ä¸å¯ã«ãã 291 $modal.add($modal.find("*")).css("pointer-events", "auto"); // ã¢ã¼ãã«å ã¯æä½å¯è½ã«ãã 292 293 // .overview ã® z-index ã 2000 ã«è¨å® 294 $(".overview").css("z-index", 2000); 295 }); 296 297 // Close Modal 298 $(".modal-close").on("click", function () { 299 var $modal = $(this).closest(".modal"); 300 301 // ã¢ã¼ãã«ãé表示 302 $modal.fadeOut(); 303 304 // ä»ã®è¦ç´ ã®æä½ãæå¹å 305 $("body").css("overflow", "auto"); // ã¹ã¯ãã¼ã«ãæå¹å 306 $("*").css("pointer-events", ""); // å ¨ã¦ã®è¦ç´ ã®æä½ãå ã«æ»ã 307 308 // .overview ã® z-index ã auto ã«æ»ã 309 $(".overview").css("z-index", "auto"); 310 }); 311
312 // Close Modal on Background Click 313 $(".modal").on("click", function (e) { 314 if ($(e.target).is(".modal")) { 315 var $modal = $(this); 316 317 // ã¢ã¼ãã«ãé表示 318 $modal.fadeOut(); 319 320 // ä»ã®è¦ç´ ã®æä½ãæå¹å 321 $("body").css("overflow", "auto"); // ã¹ã¯ãã¼ã«ãæå¹å 322 $("*").css("pointer-events", ""); // å ¨ã¦ã®è¦ç´ ã®æä½ãå ã«æ»ã 323 324 // .overview ã® z-index ã auto ã«æ»ã 325 $(".overview").css("z-index", "auto"); 326 } 327 }); 328 329 // ã¹ã ã¼ãºã¹ã¯ãã¼ã« 330 $(".scr").click(function () { 331 var speed = 500; 332 var href = $(this).attr("href"); 333 var target = $(href == "#" || href == "" ? "html" : href); 334 var position = target.offset().top; 335 $("html, body").animate({ scrollTop: position }, speed, "swing"); 336 return false; 337 }); 338 339 $('.acc_head').on('click', function () { 340 $(this).toggleClass('open'); 341 $(this).next('.acc_body').slideToggle(300); 342 }); 343}); 344 345// ãã¼ã¸ã¢ããåä½ 346var up = $("#pageup"); 347$(window).scroll(function () { 348 if ($(this).scrollTop() > 200) { 349 up.fadeIn(); 350 } else { 351 up.fadeOut(); 352 } 353}); 354up.click(function () { 355 // 䏿çã« scroll-behavior ãç¡å¹ã«ãã 356 $("html").css("scroll-behavior", "auto"); 357 358 // ã¹ã¯ãã¼ã«ãã¢ãã¡ã¼ã·ã§ã³ã§å®è¡ 359 $("body, html").animate({ scrollTop: 0 }, 500, function () { 360 // ã¹ã¯ãã¼ã«ãå®äºããã scroll-behavior ãå ã«æ»ã 361 $("html").css("scroll-behavior", "smooth"); 362 }); 363 364 return false; 365});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.