1document.addEventListener( 2 'DOMContentLoaded', 3 () => { 4 5 //ç£è¦ãããè¤æ°è¦ç´ 6 const targets = document.querySelectorAll("[class*='epb-animation-']"); 7 8 const callback = ( entries, observer ) => { 9 entries.forEach( ( entry ) => { 10 //isIntersectingããããã£ã¯äº¤å·®ãã¦ãããã©ããã®boolå¤ 11 //viewportã«äº¤å·®ããå ¥ã£ãã¨ãã«isIntersecting===trueãåºãã¨ãã«false 12 if ( entry.isIntersecting ) { 13 entry.target.classList.add("is-epb-active"); 14 observer.unobserve(entry.target); 15 } 16 entry.target.addEventListener( 17 'animationend', 18 () => { 19 entry.target.classList.remove("is-epb-active"); 20 entry.target.classList.add("is-epb-animationend"); 21 }, 22 false 23 ); 24 }); 25 }; 26 27 //Intersection observer ã®ãªãã·ã§ã³ã使 28 const options = { 29 root: null, 30 rootMargin: '-25% 0px', 31 thureshold: [ 0, 0.25, 0.5, 0.75, 1 ], 32 }; 33 //Intersection observer ã使 34 //ã¿ã¼ã²ããã IntersectionObserver ã«æå®ãããé¾å¤ãæºãã度ã«ã³ã¼ã«ããã¯ãå¼ã³åºããã 35 const io = new IntersectionObserver( callback, options ); 36 targets.forEach( ( target ) => { 37 //ç£è¦ããã対象ãobserve 38 io.observe( target ); 39 }); 40 false 41 } 42);
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.