#javascript #node.js #angular #typescript #gsap
#javascript #node.js #угловой #typescript #gsap
Вопрос:
Я использую Gsap и использую объект TimelineLite для обработки загрузчика и показываю процент содержимого с помощью объекта Math.round, но он не показывает точную меру, он показывает 67% процентов вместо 100% примера
ngOnInit() {
const timer = 4;
this.master = new TimelineLite();
this.master.to(this.progress.nativeElement, timer, this.progressLoader(this.master));
this.master.to(this.panel.nativeElement, 2, this.verticalShow(this.master));
}
progressLoader(obj: any) {
let newPercent: any;
this.count = this.count.nativeElement;
const vars = {
width: '100%',
ease: Power2.easeOut,
onUpdate: () => {
console.log(newPercent = Math.round((obj.progress() * 100)));
this.count.innerHTML = newPercent '%';
}
};
return vars;
}