Skip to content

Commit

Permalink
Create custom.js
Browse files Browse the repository at this point in the history
  • Loading branch information
RizwanMunawar authored Nov 15, 2024
1 parent ef06ab4 commit e5c2759
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/assets/js/custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Example: Smooth scroll for anchor links
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 e5c2759

Please sign in to comment.