0.0.9 • Published 3 years ago
rc-backtotop v0.0.9
backtotop
A simple vanilla js back-to-top button.
Installation
npm install renancalmet/backtotopUsage
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 exporting the class + making adist/backtotop.jsfollowing this tutorial