jquery.scrollup插件实现返回顶部的效果

1、页面引入文件jquery.js与jquery.scrollup.js

2、页面中定义返回顶部按钮的css样式,如

#scrollUp {
    background: rgba(0, 0, 0, 0) url("scrolltop.png") no-repeat scroll 0 0;
    bottom: 20px;
    height: 38px;
    right: 130px;
    width: 38px;
}

3、页面中加入js代码

<script type="text/javascript">
                $.scrollUp({
                scrollName: 'scrollUp', // Element ID
                topDistance: '260', // 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: '', // Text for element
                activeOverlay: false  // Set CSS color to display scrollUp active point, e.g '#00FFFF'
            });
</script>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值