crollUp 是一款轻量的 jQuery 插件,用于实现定制的滚动到顶部(Scroll To Top)功能。ScrollUp 可以通过 CSS 完全定制,这使得它能够非常简单到集成到你的项目中。官方提供了 Tap、Pill、Llink、Image 五种风格,可以根据需要配置。
Minimum setup
$(function(){
$.scrollUp();
});
Example with default options
$(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'
});
});
Fully Customisable
#scrollUp {
bottom: 20px;
right: 20px;
padding: 10px 20px;
background: #555;
color: #fff;
}