Counter-Up icon indicating copy to clipboard operation
Counter-Up copied to clipboard

Scrolling away from counter then back again gives incorrect final value

Open russelcole opened this issue 10 years ago • 6 comments

I came across a problem with scrolling away from the counter whilst it was still in progress and then scrolling back again

If the original value is 100 and I scrolled away at 50, when I scrolled back it would count from 0 to 50 not 100

I fixed this by: var $settings = settings; var $originalText = $this.text(); // added this line

Changed: var num = $this.text(); to var num = $originalText;

russelcole avatar Feb 08 '16 10:02 russelcole

In Chrome I had numbers 0 ... 0 ... 0

Your fix helped. Thanks !

artreaktor-niks avatar Feb 14 '16 23:02 artreaktor-niks

Fixed for me too! You should make a pull request or fork. This project doesn't seem to kept up with.

rginnow avatar Feb 15 '16 17:02 rginnow

Hi All, i needed this more reliable for a project, so i forked it and added a 'total' variable that it always relies on. If the total is missing, it will work as per the original, using the text supplied by "$this.text()".

Here it is:

https://github.com/onepartscissors/Counter-Up

onepartscissors avatar Feb 25 '16 11:02 onepartscissors

In my fork I merged a bunch of PRs - it's already on bower and NPM.

This issue should be fixed with Waypoints-4.0.0 support (thanks to @digsite PR), please check it out and tell me if it works. Thanks!

ciromattia avatar Mar 24 '16 11:03 ciromattia

You can look up a simple solution on the CounterUp side (rather than changing WayPoint integration) on my reply at https://github.com/bfintal/Counter-Up/issues/57#issuecomment-369732234. It is a needed fix anyway, even if you use the correct new WayPoint methods.

dnunes avatar Mar 01 '18 21:03 dnunes

Thanks, this fork works for me :D

k4dm3l avatar Jun 05 '19 22:06 k4dm3l