Sydney FP: Facts Restart

Good morning,

is it possible to restart the count up everytime you scroll to this area, not only once?

Thanks,
CK

Dear CK,

Apologies, it isn’t an easy task to accomplish. I can’t provide you with a working code here. But the possible workaround you would try is modifying the core theme’s jQuery script in the following line:

var counter = function() {
	$('.roll-counter').on('on-appear', function() {
		$(this).find('.numb-count').each(function() {
			var to = parseInt($(this).attr('data-to')), speed = parseInt($(this).attr('data-speed'));
			$(this).countTo({
				to: to,
				speed: speed
			});
		});
	}); //counter
};

You would need to wrap that function inside a conditional check as the counter element be visible on viewport. You could use jQuery Waypoints.

If possible, I’d recommend you overriding that main JS in the child theme mode. Please refer here. So that the modifications you’ve made will remain once the theme gets updated in the future.

I hope this reply helps.

Regards,
Kharis

A bit late, but thank you very much!

I think you’re looking for this (I know it’s late but I think it can help other users)

Dear Ehsan,

Thank you for sharing. We really appreciated it. It would be extremely useful for others.

Regards,
Kharis