Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('a[href^="#"]').on('click', function(event) {
- var target = $(this.getAttribute('href'));
- if (target.length) {
- event.preventDefault();
- }
- target
- .get(0)
- .scrollIntoView({
- behavior: 'smooth'
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement