jquery回到顶端插件返回顶部功能

发布时间:2019-11-15编辑:脚本学堂
jquery插件实现回到顶端与返回顶部功能,包括主要参数,scrollup.js插件实现返回顶部的例子,需要的朋友参考下。

主要参数:
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'
});
});