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:
parent
b96360ec89
commit
f389f2af69
@ -212,6 +212,10 @@ function router() {
|
||||
path = path + ".md";
|
||||
}
|
||||
|
||||
// 取消scroll事件的监听函数
|
||||
// 防止改变下面的变量perc的值
|
||||
$(window).off('scroll');
|
||||
|
||||
// otherwise get the markdown and render it
|
||||
var loading = show_loading();
|
||||
$.get(path, function(data) {
|
||||
@ -283,7 +287,7 @@ function router() {
|
||||
var h = $('body').height();
|
||||
var sHeight = h - wh;
|
||||
|
||||
$w.off('scroll').on('scroll', function() {
|
||||
$w.on('scroll', function() {
|
||||
var perc = Math.max(0, Math.min(1, $w.scrollTop() / sHeight));
|
||||
updateProgress(perc);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user