geno/wp-content/themes/astra/assets/js/minified/smooth-scroll.min.js

1 line
271 B
JavaScript
Raw Permalink Normal View History

2024-02-01 17:24:18 +05:30
const links=document.querySelectorAll("a");if(links)for(const a of links)""!==a.hash&&a.addEventListener("click",clickHandler);function clickHandler(e){e.preventDefault();e=this.getAttribute("href"),e=document.querySelector(e).offsetTop;scroll({top:e,behavior:"smooth"})}