https://github.com/evavic44/jquery-smooth-scroll
A jQuery solution I use quite often for scrolling to same page links smoothly.
https://github.com/evavic44/jquery-smooth-scroll
Last synced: about 2 months ago
JSON representation
A jQuery solution I use quite often for scrolling to same page links smoothly.
- Host: GitHub
- URL: https://github.com/evavic44/jquery-smooth-scroll
- Owner: Evavic44
- Created: 2021-01-17T19:31:48.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-06T15:17:03.000Z (over 2 years ago)
- Last Synced: 2025-06-02T08:15:47.987Z (4 months ago)
- Language: HTML
- Homepage: https://scroll-away-your-sorrows.netlify.app/
- Size: 59.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Smooth Scroll - jQuery
### This is a simple illustration website to explain how smooth scrolling works and looks like.
Copy this script tag and paste in html page to use:
```js
```
##### [jQuery link to other versions](https://code.jquery.com/)
### jQuery block of code: :point_down:
```js
{
// Smooth Scrolling
$('#navbar a, .btn').on('click', function (e) {
if (this.hash !== '') {
e.preventDefault();const hash = this.hash;
$('html, body').animate(
{
scrollTop: $(hash).offset().top - 100,
},
800
);
}
});
}
```