实现阮一峰ES6的顶部加载条效果
来源:互联网 发布:阿里云更换操作系统 编辑:程序博客网 时间:2024/06/01 08:20
效果例子
阮一峰的ES6:http://es6.ruanyifeng.com/?search=s&x=13&y=3
html + css
<style type="text/css"> #loading-progress{ position: fixed; top: 0; left: 0; height: 3px; background-color: #0A74DA; z-index: 100; } </style> <div id="loading-progress"></div>
jquery监听滚动事件
$(document).ready(function() { // 监听内容的滚动事件 $("#content").scroll(function() { var progress = $(this).context.scrollTop / ($(this).context.scrollHeight - $(this).context.offsetHeight); if (progress >= 1) { progress = 1; } var width = document.body.clientWidth * progress; console.log(width); // 设置 加载条 的宽度 $("#loading-progress").width(width); }); });
阅读全文
0 0
- 实现阮一峰ES6的顶部加载条效果
- RecyclerView实现顶部悬浮条效果 自定义!
- TabLayout实现仿今日头条顶部tab导航效果
- JavaScript回到顶部的滑动效果实现
- javascript 回到顶部的效果实现
- CSS实现网页顶部的阴影效果
- 如何实现“返回顶部”的页面效果
- Ionic 顶部贴附效果的实现
- 返回顶部效果的代码实现
- 跟随滚动条漂浮的返回顶部按钮效果
- ES6之Module 的加载实现(1)
- ES6之Module 的加载实现(2)
- ES6之Module 的加载实现(3)
- ES6 —(Module 的加载实现)
- 仿网易新闻顶部滑动条效果
- 仿今日头条顶部导航效果
- 滚动加载条效果
- Viewpager实现今日头条顶部导航的功能
- To Install Android Studio in Ubuntu 16.04 and Ubuntu 17.04
- NSUserDefaults 存储可变数组,对象。
- JSP page指令 关于isErrorPage指定错误页面的使用
- ScrollView和RecyclerView嵌套问题
- Linux根目录介绍
- 实现阮一峰ES6的顶部加载条效果
- 重定向用户
- how to extract code of apk file
- lamp源码包安装
- Mars简介
- android 相關網址
- MyEclipse Tern was unable to complete your request in time
- 動態開關android log level
- C++中的值传递和引用传递