exizt.scroll-top
v4.6.19
Published
> The script that creates an arrow in the bottom-right corner of the screen to scroll back to the top.
Downloads
149
Readme
ScrollTop JS
The script that creates an arrow in the bottom-right corner of the screen to scroll back to the top.
- Github: https://github.com/exizt/scroll-top/
- Demo : https://exizt.github.io/scroll-top/
Download and Setup
- Download and place the files in a project directory.
- using
dist/scroll-top.mix.js
file.
Usage
html
<script type="module" src="dist/scroll-top.mix.js"></script>
or
<link rel="stylesheet" href="dist/scroll-top.css">
<script type="module">
import { ScrollTop } from 'dist/scroll-top.js';
const scrolltop = new ScrollTop()
scrolltop.load()
</script>
Options
Option List
base
: Minimum height value for symbol visibility.- (type
number
, default100
)
- (type
debug
: debug log..- (type
boolean
, defaultfalse
)
- (type
(example)
scrolltop.load({
base:300
})
How to use option
html, js
<link rel="stylesheet" href="../dist/scroll-top.css">
<script type="module">
import { ScrollTop } from '../dist/scroll-top.js';
const scrolltop = new ScrollTop()
scrolltop.load()
</script>
npm, typescript
npm
npm install --save-dev exizt.scroll-top
TypeScript
import { ScrollTop } from 'exizt.scroll-top'
const scrolltop = new ScrollTop()
scrolltop.load()
License
MIT License