1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 18:32:22 +00:00

edit js/ditto

This commit is contained in:
ruanyf 2015-12-03 15:20:42 +08:00
parent ce893ab576
commit 1a6aa1ae42
2 changed files with 112 additions and 114 deletions

View File

@ -625,7 +625,7 @@ export function odd(n) {
}
```
上面代码中,`even.js`里面的函数`foo`有一个参数`n`只要不等于0就会减去1传入加载的`odd()``odd.js`也会做类似操作。
上面代码中,`even.js`里面的函数`even`有一个参数`n`只要不等于0就会减去1传入加载的`odd()``odd.js`也会做类似操作。
运行上面这段代码,结果如下。

View File

@ -193,7 +193,6 @@ function show_loading() {
}
function router() {
var path = location.hash.replace(/#([^#]*)(#.*)?/, './$1');
if (ditto.save_progress && store.get('menu-progress') !== location.hash) {
@ -287,7 +286,6 @@ function router() {
var wh = $w.height();
var h = $('body').height();
var sHeight = h - wh;
$w.on('scroll', function() {
window.requestAnimationFrame(function(){
var perc = Math.max(0, Math.min(1, $w.scrollTop() / sHeight));