Skip to content

Commit

Permalink
Create script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiran18b authored Aug 13, 2024
1 parent 5aef573 commit be4052d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Example: Smooth scroll to sections
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});

0 comments on commit be4052d

Please sign in to comment.