Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Anchor Smooth Scroll's Animation */
- (function () {
- document.querySelectorAll('[href^="#"]').forEach(anchor => {
- anchor.addEventListener('click', function (e) {
- e.preventDefault();
- const link = document.querySelector(this.getAttribute('href'));
- console.log(link);
- link.scrollIntoView({
- behavior: 'smooth'
- });
- });
- });
- }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement