dotnet-foundation / dotnetfoundation-website

.NET Foundation Website
MIT License
47 stars 47 forks source link

Home Page Stats counter broken. #43

Open prkhandelwal opened 6 years ago

prkhandelwal commented 6 years ago

The stats counter values keep decreasing each time you scroll up and scroll down again.

jongalloway commented 6 years ago

Can't reproduce - I think this might have been an issue during the deployment. Are you still seeing this?

prkhandelwal commented 6 years ago

Yes the issue is still present. I am attaching a link to video reproducing the bug.

https://1drv.ms/v/s!AmPSCdCSeks4j8kgIl0svnIgLTb9TA

andrewcahill commented 6 years ago

Yeah you will only see it once the browser window is smaller than the height between the top of the counters and the top of the browser window - effectively running this counter each time you scroll from top to bottom.

There is a javascript function within : https://github.com/dotnet/dotnetfoundation-website/blob/master/src/wwwroot/js/home.js between lines 5-25 to determine this range and will initiate the counter animation.

prkhandelwal commented 6 years ago

The issue is, each time I scroll down from the top the range of counter keeps decreasing.

jongalloway commented 5 years ago

Looks like this is a known issue with the jQuery plugin, a fix is to store the initial value: https://github.com/bfintal/Counter-Up/issues/57#issuecomment-369732234