【发布时间】:2020-03-23 05:34:35
【问题描述】:
我正在使用 pace.js 加载我的网站。但我不想使用pace.js 主题。我想建立我的主题。
有什么方法可以让我使用 jquery 取得进展吗?
我只知道这个功能:
Pace.on("start", function(){
});
Pace.on("done", function(){
})
【问题讨论】:
我正在使用 pace.js 加载我的网站。但我不想使用pace.js 主题。我想建立我的主题。
有什么方法可以让我使用 jquery 取得进展吗?
我只知道这个功能:
Pace.on("start", function(){
});
Pace.on("done", function(){
})
【问题讨论】:
只需在第 296 行添加:
Pace.trigger('update', this.progress);
然后变成这样:
Pace.on("update", function(percent){
});
【讨论】:
我已经这样做了
Pace.bar.update = function(prog) {
Pace.trigger('update', prog)
this.progress = prog;
return this.render();
} // override update func to trigger 'update' event
以后
Pace.on('update', progress => {
console.log('progress -> ', progress);
})
【讨论】: