Animate progress bar on scroll

后端 未结 1 881
无人共我
无人共我 2021-01-14 01:34

I have a progress bar that animates when the page loads, but I want it to animate when the user scrolls down to it, as it will be in the middle of the page. Right now if the

相关标签:
1条回答
  • 2021-01-14 02:19

    how about this?

    I updated your jsFiddle http://jsfiddle.net/YAZJb/1/

    Essentially all I did was add a width:100%; and position:fixed; to your div with the class meter

    That's, of course, If I understood your question correctly? You want the progress bar to stay in view even if the user scrolls?

    update:

    you could use something like the inview plugin. Here is the download and the demo is here. Wrap it around your own script for your progress bar and it won't start to animate until in view.

    0 讨论(0)
提交回复
热议问题