“回到顶部”
来源:互联网 发布:mysql选择数据库 编辑:程序博客网 时间:2024/04/28 03:24
<button id="gotoTop" class="gotoTop" type="button">To the top</button>
window.onload = function () { document.getElementById('gotoTop').onclick = function () { scrollTo(document.body, 0, 100); }} function scrollTo(element, to, duration) { if (duration < 0) return; var difference = to - element.scrollTop; var perTick = difference / duration * 10; setTimeout(function () { element.scrollTop = element.scrollTop + perTick; scrollTo(element, to, duration - 10); }, 10);}
.gotoTop { position:fixed; right:20px; bottom:20px;}
Du_A http://zhidao.baidu.com/question/1667937056094404787.html?push=keyword
- 回到顶部
- 回到顶部
- 回到顶部
- 回到顶部
- “回到顶部”
- 回到顶部
- 回到顶部
- 回到顶部
- 回到顶部
- 回到顶部
- 回到顶部
- 回到顶部
- 回到顶部
- 回到顶部
- 回到顶部
- 回到顶部
- 回到顶部
- 回到顶部
- 内核模块基础
- Linux系列-Linux多命令协作:管道及重定向
- Hadoop虚拟集群的搭建
- Socket send函数和recv函数详解
- 基于STK/Matlab的GPS卫星可见性仿真分析
- “回到顶部”
- python中字典常用函数()
- 合并k个有序链表 Merge k Sorted Lists
- confirm(jQuery)
- 求1000以内所有偶数的和
- 微信难以成为传统零售们的电商造梦园
- 怎样运用servlet
- android多lib库工程的自动批量构建--准备
- 学习计划