https://github.com/edenreich/javascript-topscroller-module
An icon that appears on the corner of the screen as the user starts scrolling and allow them to scroll back to the top
https://github.com/edenreich/javascript-topscroller-module
Last synced: 7 months ago
JSON representation
An icon that appears on the corner of the screen as the user starts scrolling and allow them to scroll back to the top
- Host: GitHub
- URL: https://github.com/edenreich/javascript-topscroller-module
- Owner: edenreich
- Created: 2017-06-30T14:56:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-16T16:47:09.000Z (about 7 years ago)
- Last Synced: 2025-01-16T16:43:01.798Z (9 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Javascript-TopScroller-Module
An icon that appears on the corner of the screen as the user starts scrolling and allow them to scroll back to the top## How to use
In your HTML simply import the script and use it.
```html
Demo
(function() {
TopScroller.init({
after: '300px',
background: 'rgba(0, 0, 0, 0.5)',
backgroundHover: 'red',
position: {
distance: '20px',
corner: ['top', 'left'],
}
});
})();
```
## Options
```javascript
TopScroller.init({
after: '300px', // the offset position of the window that the scroll element should appear.
background: 'rgba(0, 0, 0, 0.5)', // background color of that element.
backgroundHover: 'red', // hover state color of that element.
position: {
distance: '20px', // the distance from the left top corner the element should be positioned.
corner: ['top', 'left'],
}
});
```If you see something that can be imporved, let me know or send me a pull request, cheers ! :)