- 1
- 2
- 3
- 4
- 5
- 6
- 7
xhr.upload.addEventListener('progress', function (e) {
if (e.lengthComputable) {
let percents = Math.round(e.loaded / e.total * 100)
$(`#preloader-${preloaderId}`).html(`${percents}%`)
$(`#preloader-${preloaderId}`).append(`<style>#preloader-${preloaderId}:before{ width: ${percents * 0.94}px;}</style>`);
}
}, false);