Facts Numbers

Hi,

On my site I use the facts widget to display the numbers 5, 802, 23, and 4169. However when I refresh the page or when I scroll, the counting animation stops and the number freezes in place (ex. 4169 stops and becomes 4168 or even lower).

Thanks

Hi, yes it is happening with large numbers. Try to edit scripts.js file (theme folder > js), and change duration (duration: 2000).

//Waypoints
jQuery(function($) {
	$('.fact').waypoint(function(down) {
		$('.fact').each(function () {
			var $this = $(this);
			$({ Counter: 0 }).animate({ Counter: $this.attr('id') }, {
				duration: 1000,
				easing: 'swing',
				step: function () {
				    $this.text(Math.ceil(this.Counter));
				}
			});
		});
	}

I tried several times and it was OK.

It worked thanks!

Hi all,

I’m currently having this issue. I tried incrementing the timing in the scripts file and that did not seem to help with the accuracy.

Any other suggestions?

I found a working solution, you’ll want to further edit the scripts.js file to add the complete method as shown below:

			step: function () {
			    $this.text(Math.ceil(this.Counter));
			},
			complete: function() {
				$this.text(Math.ceil($this.attr('id')));
			}
1 Like