1// åä¸ãã¼ã¸å ã¢ã³ã«ã¼ãªã³ã¯ã®ã¹ã¯ãã¼ã«å¦çã 2// URL ããã·ã¥ã¯æ´æ°ãããå±¥æ´ã«ã¯ç©ã¾ãªã (replaceState) ããã 3// æ»ããã¿ã³ã§ã¢ã³ã«ã¼ç§»åãå·»ãæ»ããåãã¼ã¸ã¸ç´æ¥æ»ããã 4export function anchorLink() { 5 document.querySelectorAll('a[href^="#"]').forEach((link) => { 6 link.addEventListener('click', (e) => { 7 const href = link.getAttribute('href'); 8 if (!href || href === '#') return; 9 const target = document.getElementById(href.slice(1)); 10 if (!target) return; 11 e.preventDefault(); 12 // behavior ã¯æå®ãã CSS ã® scroll-behavior ã«å§ãã 13 // (prefers-reduced-motion è¨å®ãåæ ããã) 14 target.scrollIntoView({ block: 'start' }); 15 history.replaceState(null, '', href); 16 }); 17 }); 18}
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.