主要参数:
scrollName: 'scrollUp', // Element ID
topDistance: '300', // Distance from top before showing element (px)
topSpeed: 300, // Speed back to top (ms)
animation: 'fade', // Fade, slide, none
animationInSpeed: 200, // Animation in speed (ms)
animationOutSpeed: 200, // Animation out speed (ms)
scrollText: 'Scroll to top', // Text for element
activeOverlay: false,
// 帮助定位“回到顶端”按钮出现时滚动到的页面位置。
jquery代码(ScrollUp.js):
复制代码 代码示例:
$(function () {
$.scrollUp({
scrollName: 'scrollUp',
// Element ID
topDistance: '300',
// Distance from top before showing element (px)
topSpeed: 300,
// Speed back to top (ms)
animation: 'fade',
// Fade, slide, none
animationInSpeed: 200,
// Animation in speed (ms)
animationOutSpeed: 200,
// Animation out speed (ms)
scrollText: 'Scroll to top',
// Text for element
activeOverlay: false,
// set css color to display scrollup active point, e.g '#00ffff'
});
});