0

I have countup.js library in my document. When I scroll down I want to start that function. Now It begins immediately. How to fix it in vanilla.js.

I tried:

Onload(); 

on iframe elements above div with countup.js

Prashant Pimpale
  • 8,749
  • 6
  • 30
  • 70
  • 2
    Possible duplicate of [Check if element is visible after scrolling](https://stackoverflow.com/questions/487073/check-if-element-is-visible-after-scrolling) – Chris G Sep 22 '18 at 13:37
  • If this is literally just about turning the mouse wheel, add an `onscroll` listener to your `window`. – Chris G Sep 22 '18 at 13:38
  • When i used onscroll for window the function was turned on every scroll mouse. –  Sep 22 '18 at 14:06
  • You need to ensure it only runs once, either by using a variable or removing the event listener after the first run. – Chris G Sep 22 '18 at 14:09

0 Answers0