Guest Posted October 5, 2020 Share Posted October 5, 2020 Site URL: https://www.orcasoundproject.com/ Hello, I have created an animated counter with the help of a code injection at the bottom of the landing page. However it starts the counter when loading the page instead of when you scroll to the section defeating the point of the animation as you never get to see it. Is there any code to make start the animation only when you scroll to the desired section? Here is the code I've used for the animation: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> $(document).ready(function() { // Animate the element's value from 0% to 110%: jQuery({someValue: 0}).animate({someValue: 5}, { duration: 2000, easing:'swing', // can be anything step: function() { // called on every step // Update the element's text with rounded-up value: $('#block-yui_3_17_2_1_1601088407765_22146 h2').text(Math.ceil(this.someValue) + ""); } }); }); </script> Thanks! Link to comment
tuanphan Posted October 6, 2020 Share Posted October 6, 2020 Hi. Have you fixed this yet? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
bonniergcuk Posted October 22, 2020 Share Posted October 22, 2020 @tuanphan Do you know a possible solution to this? I have a similar problem where my counter counts on page entry, any help would be really appreciated 🙂 Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.