到顶部
显示一个链接或按钮,当用户开始滚动时,会将他们带回顶部。
用法
var ttt = require ( 'to-the-top' ) ;
var t = ttt . byPixels ( window , 1300 ) ;
var t = ttt . byPixelsToBottom ( window , 1300 ) ;
var t = ttt . byPages ( window , 1.5 ) ; // show after 1.5 screen height
t . $ // a div DOM element you'll need to attach somewhere