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

来源:互联网 发布:淘宝 房产 编辑:程序博客网 时间:2024/05/21 06:44

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>


0 0
原创粉丝点击