Based on zeptojs, encapsulation of a back top plug
-
Import file
<script src="zepto.min.js"></script> <script src="backToTop.js"></script>
-
then
$('.element').backToTop({ type:'doubleTap', duration:500, target:100 })
options
- type {String}, default is 'tap'
- doubleTap, longTap, tap, click
- target {Number}, Moving target point
- duration {Number} Moving of time
- must be ms
- easing {String}, Moving of easing
- linear, ease-in, ease-out
git clone https://github.com/itstrive/backToTop.git
bower install tinyBack
npm install tiny-back -D
If you have any questions, please contact me.
MIT