当用户向下滚动到该部分时,我正在尝试将圆形进度条加载到加载。
当用户达到某一点时,触发功能和进度条动画,但如果你上下滚动它会重启功能,怎么修复?
$(window).scroll(function() {
var wScroll = $(this).scrollTop();
if (wScroll > $('#skills').offset().top - ($(window).height() / 1.9)) {
//PROGRESS BAR CODE GOES HERE
}
答案 0 :(得分:2)
Just check if animation started and don't restart if it is.
if (window.playing) return;
window.playing = true;
获取href