Premier commit de mon portfolio
This commit is contained in:
8
script.js
Normal file
8
script.js
Normal file
@@ -0,0 +1,8 @@
|
||||
const links = document.querySelectorAll('a.nav-link, .navbar-brand');
|
||||
links.forEach(link => {
|
||||
link.addEventListener('click', function(e){
|
||||
e.preventDefault();
|
||||
const target = document.querySelector(this.getAttribute('href'));
|
||||
target.scrollIntoView({behavior:'smooth'});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user