mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-25 03:02:21 +00:00
edit js/ditto
This commit is contained in:
parent
ce893ab576
commit
1a6aa1ae42
@ -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`也会做类似操作。
|
||||||
|
|
||||||
运行上面这段代码,结果如下。
|
运行上面这段代码,结果如下。
|
||||||
|
|
||||||
|
@ -193,7 +193,6 @@ function show_loading() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function router() {
|
function router() {
|
||||||
|
|
||||||
var path = location.hash.replace(/#([^#]*)(#.*)?/, './$1');
|
var path = location.hash.replace(/#([^#]*)(#.*)?/, './$1');
|
||||||
|
|
||||||
if (ditto.save_progress && store.get('menu-progress') !== location.hash) {
|
if (ditto.save_progress && store.get('menu-progress') !== location.hash) {
|
||||||
@ -287,7 +286,6 @@ function router() {
|
|||||||
var wh = $w.height();
|
var wh = $w.height();
|
||||||
var h = $('body').height();
|
var h = $('body').height();
|
||||||
var sHeight = h - wh;
|
var sHeight = h - wh;
|
||||||
|
|
||||||
$w.on('scroll', function() {
|
$w.on('scroll', function() {
|
||||||
window.requestAnimationFrame(function(){
|
window.requestAnimationFrame(function(){
|
||||||
var perc = Math.max(0, Math.min(1, $w.scrollTop() / sHeight));
|
var perc = Math.max(0, Math.min(1, $w.scrollTop() / sHeight));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user