Horje
smooth scroll to anchor Code Example
smooth scroll to anchor
/* Just use Native HTML Smooth Scroll */
html {
  scroll-behavior: smooth;
}
javascript smooth scroll to anchor element
//add smooth scrolling when clicking any anchor link
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
    anchor.addEventListener('click', function (e) {
        e.preventDefault();
        document.querySelector(this.getAttribute('href')).scrollIntoView({
            behavior: 'smooth'
        });
    });
});
//<a rel="nofollow" href="#someOtherElementID"> Go to Other Element Smoothly </a>
smooth scroll css
html {
  scroll-behavior: smooth;
}

/* No support in IE, or Safari
You can use this JS polyfill for those */
http://iamdustan.com/smoothscroll/
smooth scroll on anchor tag
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
    anchor.addEventListener('click', function (e) {
        e.preventDefault();

        document.querySelector(this.getAttribute('href')).scrollIntoView({
            behavior: 'smooth'
        });
    });
});




Css

Related
css wrap text to next line Code Example css wrap text to next line Code Example
css make image gray Code Example css make image gray Code Example
wordpress smooth scroll to anchor Code Example wordpress smooth scroll to anchor Code Example
Can't resolve @emotion/react Code Example Can't resolve @emotion/react Code Example
html print page break Code Example html print page break Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10