rc-backtotop
v0.0.9
Published
A back-to-top simple js button.
Downloads
7
Maintainers
Readme
backtotop
A simple vanilla js back-to-top button.
Installation
npm install renancalmet/backtotop
Usage
In document head :
<link rel="stylesheet" href="node_modules/backtotop/backtotop.css">
At the end of <body>
:
<script src="node_modules/backtotop/index.js"></script>
<script>
const bouton = new backToTop(700, '.button');
</script>
The class parameters are :
700
: the first pixel from which the backtotop button is displayed.'.button'
: the CSS selector to identify the button.
TODO
- Add positioning parameters
- Stylize appearance/disappearance
- Make it a real node module by
default export
ing the class + making adist/backtotop.js
following this tutorial