1 2//=============================================================== 3// debounce颿° 4//=============================================================== 5function debounce(func, wait) { 6 var timeout; 7 return function() { 8 var context = this, args = arguments; 9 var later = function() { 10 timeout = null; 11 func.apply(context, args); 12 }; 13 clearTimeout(timeout); 14 timeout = setTimeout(later, wait); 15 }; 16} 17 18 19//=============================================================== 20// ã¡ãã¥ã¼é¢é£ 21//=============================================================== 22 23// 夿°ã§ã»ã¬ã¯ã¿ã管ç 24var $menubar = $('#menubar'); 25var $menubarHdr = $('#menubar_hdr'); 26 27// menu 28$(window).on("load resize", debounce(function() { 29 if(window.innerWidth <= 900) { // ããããã¬ã¤ã¯ãã¤ã³ãæå®ç®æã§ã 30 // å°ããªç«¯æ«ç¨ã®å¦ç 31 $('body').addClass('small-screen').removeClass('large-screen'); 32 $menubar.addClass('display-none').removeClass('display-block'); 33 $menubarHdr.removeClass('display-none ham').addClass('display-block'); 34 } else { 35 // 大ããªç«¯æ«ç¨ã®å¦ç 36 $('body').addClass('large-screen').removeClass('small-screen'); 37 $menubar.addClass('display-block').removeClass('display-none'); 38 $menubarHdr.removeClass('display-block').addClass('display-none'); 39 40 // ãããããã¦ã³ã¡ãã¥ã¼ãéãã¦ããã°ããããéãã 41 $('.ddmenu_parent > ul').hide(); 42 } 43}, 10)); 44 45$(function() { 46 47 // ãã³ãã¼ã¬ã¼ã¡ãã¥ã¼ãã¯ãªãã¯ããéã®å¦ç 48 $menubarHdr.click(function() { 49 $(this).toggleClass('ham'); 50 if ($(this).hasClass('ham')) { 51 $menubar.addClass('display-block'); 52 } else { 53 $menubar.removeClass('display-block'); 54 } 55 }); 56 57 // ã¢ã³ã«ã¼ãªã³ã¯ã®å ´åã«ã¡ãã¥ã¼ãéããå¦ç 58 $menubar.find('a[href*="#"]').click(function() { 59 $menubar.removeClass('display-block'); 60 $menubarHdr.removeClass('ham'); 61 }); 62 63 // ãããããã¦ã³ã®è¦ªliã¿ã°ï¼ç©ºã®ãªã³ã¯ãæã¤aã¿ã°ã®ããã©ã«ãåä½ã鲿¢ï¼ 64 $menubar.find('a[href=""]').click(function() { 65 return false; 66 }); 67 68 // ãããããã¦ã³ã¡ãã¥ã¼ã®å¦ç 69 $menubar.find('li:has(ul)').addClass('ddmenu_parent'); 70 $('.ddmenu_parent > a').addClass('ddmenu'); 71 72// ã¿ããéå§ä½ç½®ãæ ¼ç´ãã夿° 73var touchStartY = 0; 74 75// ã¿ããããã¤ã¹ç¨ 76$('.ddmenu').on('touchstart', function(e) { 77 // ã¿ããéå§ä½ç½®ãè¨é² 78 touchStartY = e.originalEvent.touches[0].clientY; 79}).on('touchend', function(e) { 80 // ã¿ããçµäºæã®ä½ç½®ãåå¾ 81 var touchEndY = e.originalEvent.changedTouches[0].clientY; 82 83 // ã¿ããéå§ä½ç½®ã¨ã¿ããçµäºä½ç½®ã®å·®åãè¨ç® 84 var touchDifference = touchStartY - touchEndY; 85 86 // ã¹ã¯ãã¼ã«åä½ã§ãªãï¼å·®åãå°ããï¼å ´åã«ã®ã¿ãããããã¦ã³ãå¶å¾¡ 87 if (Math.abs(touchDifference) < 10) { // 10px以ä¸ã®ç§»åãªãã¿ããã¨ã¿ãªã 88 var $nextUl = $(this).next('ul'); 89 if ($nextUl.is(':visible')) { 90 $nextUl.stop().hide(); 91 } else { 92 $nextUl.stop().show(); 93 } 94 $('.ddmenu').not(this).next('ul').hide(); 95 return false; // ãããããã¦ã³ã®ãªã³ã¯ããã©ãã¼ãããã®ãé²ã 96 } 97}); 98 99 //PCç¨ 100 $('.ddmenu_parent').hover(function() { 101 $(this).children('ul').stop().show(); 102 }, function() { 103 $(this).children('ul').stop().hide(); 104 }); 105 106 // ãããããã¦ã³ããã¼ã¸å ãªã³ã¯ã§ä½¿ã£ãå ´åã«ããããããã¦ã³ãéãã 107 $('.ddmenu_parent ul a').click(function() { 108 $('.ddmenu_parent > ul').hide(); 109 }); 110 111}); 112 113 114//=============================================================== 115// å°ããªã¡ãã¥ã¼ãéãã¦ããéã®ã¿ãbodyè¦ç´ ã®ã¹ã¯ãã¼ã«ãç¦æ¢ã 116//=============================================================== 117$(function() { 118 function toggleBodyScroll() { 119 // æ¡ä»¶ããã§ã㯠120 if ($('#menubar_hdr').hasClass('ham') && !$('#menubar_hdr').hasClass('display-none')) { 121 // #menubar_hdr ã 'ham' ã¯ã©ã¹ãæã¡ãã㤠'display-none' ã¯ã©ã¹ãæããªãå ´åãã¹ã¯ãã¼ã«ãç¦æ¢ 122 $('body').css({ 123 overflow: 'hidden', 124 height: '100%' 125 }); 126 } else { 127 // ãã®ä»ã®å ´åãã¹ã¯ãã¼ã«ãåã³å¯è½ã« 128 $('body').css({ 129 overflow: '', 130 height: '' 131 }); 132 } 133 } 134 135 // åæãã¼ãæã«ãã§ãã¯ãå®è¡ 136 toggleBodyScroll(); 137 138 // ã¯ã©ã¹ãåçã«å¤æ´ããããã¨ãæ³å®ãã¦ãMutationObserverã使ç¨
139 const observer = new MutationObserver(toggleBodyScroll); 140 observer.observe(document.getElementById('menubar_hdr'), { attributes: true, attributeFilter: ['class'] }); 141}); 142 143 144//=============================================================== 145// ã¹ã ã¼ã¹ã¹ã¯ãã¼ã«ï¼â»ãã¼ã¸ã§ã³2024-7ï¼â»#menubarã®é«ããåå¾ããå ´å 146//=============================================================== 147$(function() { 148 // ãã¼ã¸ããããã¿ã³ã®è¡¨ç¤ºã»é表示 149 var scroll = $('.pagetop'); 150 var scrollShow = $('.pagetop-show'); 151 $(scroll).hide(); 152 $(window).scroll(function() { 153 if ($(this).scrollTop() >= 300) { 154 $(scroll).fadeIn().addClass(scrollShow); 155 } else { 156 $(scroll).fadeOut().removeClass(scrollShow); 157 } 158 }); 159 160 // ã¹ã ã¼ã¹ã¹ã¯ãã¼ã« 161 function smoothScroll(target) { 162 var menubarHeight = 0; // åæå¤ 163 if ($('body').hasClass('large-screen')) { 164 menubarHeight = $('#menubar').outerHeight(); // .large-screenã¯ã©ã¹ãããå ´åã«#menubarã®é«ããåå¾ 165 } 166 var scroll = target.offset().top - menubarHeight; // é«ããèæ ®ãã¦ã¹ã¯ãã¼ã«ä½ç½®ãèª¿æ´ 167 $('body,html').animate({ scrollTop: scroll }, 500); 168 } 169 170 // ãã¼ã¸ããããã¿ã³ã®ã¯ãªãã¯ã¤ãã³ã 171 $('.pagetop').click(function(e) { 172 e.preventDefault(); 173 $('body,html').animate({ scrollTop: 0 }, 500); 174 }); 175 176 // ãã¼ã¸èªã¿è¾¼ã¿æã®ããã·ã¥å¦ç 177 $(window).on('load', function() { 178 var hash = location.hash; 179 if (hash) { 180 $('body,html').scrollTop(0); 181 setTimeout(function() { 182 var target = $(hash); 183 if (target.length) { 184 smoothScroll(target); 185 } 186 }, 100); 187 } 188 }); 189 190 // ãªã³ã¯ã¯ãªãã¯æã®ã¹ã ã¼ã¹ã¹ã¯ãã¼ã« 191 $(window).on('load', function() { 192 $('a[href*="#"]').click(function(e) { 193 var href = $(this).attr('href'); 194 var targetId = href.split('#')[1]; // ããã·ã¥é¨åã ããåãåºã 195 var target = $('#' + targetId); 196 if (target.length) { 197 e.preventDefault(); 198 smoothScroll(target); 199 history.pushState(null, null, '#' + targetId); // ããã·ã¥ãURLã«è¿½å 200 } 201 }); 202 }); 203}); 204 205 206 207//=============================================================== 208// æ±ç¨ééå¦ç 209//=============================================================== 210$(function() { 211 $('.openclose-parts').next().hide(); 212 $('.openclose-parts').click(function() { 213 $(this).next().slideToggle(); 214 $('.openclose-parts').not(this).next().slideUp(); 215 }); 216}); 217 218 219//=============================================================== 220// 詳細ãã¼ã¸ã®ãµã ãã¤ã«åãæ¿ã 221//=============================================================== 222$(function() { 223 // åæè¡¨ç¤º: å .thumbnail-view ã«å¯¾ãã¦ãç´å¾ã® .thumbnail ã®æåã®ç»åã表示 224 $(".thumbnail-view-parts").each(function() { 225 var firstThumbnailSrc = $(this).next(".thumbnail-parts").find("img:first").attr("src"); 226 var defaultImage = $("<img>").attr("src", firstThumbnailSrc); 227 $(this).append(defaultImage); 228 }); 229 230 // ãµã ãã¤ã«ãã¯ãªãã¯ãããã¨ãã®åä½ 231 $(".thumbnail-parts img").click(function() { 232 var imgSrc = $(this).attr("src"); 233 var newImage = $("<img>").attr("src", imgSrc).hide(); 234 235 // ãã®ãµã ãã¤ã«ã®ç´åã® .thumbnail-view è¦ç´ ãåå¾ 236 var targetPhoto = $(this).parent(".thumbnail-parts").prev(".thumbnail-view-parts"); 237 238 targetPhoto.find("img").fadeOut(400, function() { 239 targetPhoto.empty().append(newImage); 240 newImage.fadeIn(400); 241 }); 242 }); 243}); 244 245 246//=============================================================== 247// ã¹ã©ã¤ãã·ã§ã¼ 248//=============================================================== 249$(function() { 250 var slides = $('#mainimg .slide'); 251 var slideCount = slides.length; 252 var currentIndex = 0; 253 254 slides.eq(currentIndex).css('opacity', 1).addClass('active'); 255 256 setInterval(function() { 257 var nextIndex = (currentIndex + 1) % slideCount; 258 slides.eq(currentIndex).css('opacity', 0).removeClass('active'); 259 slides.eq(nextIndex).css('opacity', 1).addClass('active');
260 currentIndex = nextIndex; 261 }, 5000); // 5ç§ãã¨ã«ã¹ã©ã¤ããåãæ¿ãã 262}); 263 264 265//=============================================================== 266// ã¡ãã¥ã¼ã«fixedã¯ã©ã¹ãä»ä¸ 267//=============================================================== 268document.addEventListener("DOMContentLoaded", function() { 269 const menubar = document.getElementById('menubar'); 270 const triggerPoint = document.getElementById('trigger-point'); 271 let fixedTimeout; 272 273 const handleIntersection = debounce(function(entries) { 274 entries.forEach(entry => { 275 if (!entry.isIntersecting) { 276 menubar.classList.add('fixed'); 277 fixedTimeout = setTimeout(() => { 278 menubar.classList.add('fixed2'); 279 }, 1500); // 1.5ç§å¾ã«fixed2ã追å 280 } else { 281 menubar.classList.remove('fixed'); 282 menubar.classList.remove('fixed2'); 283 clearTimeout(fixedTimeout); // ã¿ã¤ãã¼ãã¯ãªã¢ãã¦fixed2ã®è¿½å ã鲿¢ 284 } 285 }); 286 }, 100); // é©å®å¾ æ©æéãèª¿æ´ 287 288 const observer = new IntersectionObserver(handleIntersection, { 289 root: null, 290 threshold: 0 291 }); 292 293 observer.observe(triggerPoint); 294}); 295 296 297//=============================================================== 298// æ±ç¨ééå¦ç 299//=============================================================== 300$(function() { 301 $('.openclose').next().hide(); 302 $('.openclose').click(function() { 303 $(this).next().slideToggle(); 304 $('.openclose').not(this).next().slideUp(); 305 }); 306});
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.