How do I fire this function only at the time when I scroll down to "myTargetElement" and it becomes visible on the screen, and not immediately after page is loaded?
<script src="countUp.min.js" type='text/javascript'></script>
<script>
$(document).ready(function() {
var countOptions = {
useEasing : true,
useGrouping : true,
separator : ',',
decimal : '.'
}
var customerNumber = new countUp("myTargetElement", 0, 1635, 0, 7, countOptions);
customerNumber.start();
});
</script>