sunmockyang / animate-scroll-js

Lightweight javascript library to scroll to element without jQuery
MIT License
28 stars 8 forks source link

No scroll on Chrome #4

Closed rolandtoth closed 7 years ago

rolandtoth commented 7 years ago

On Chrome v51 the animateScroll function returns 0 for the maxScroll var: https://github.com/sunmockyang/animate-scroll-js/blob/c8eb8a8d280883b2d54e82619294844d12d6cfae/AnimateScroll.js#L8

I don't exactly get what is the logic behind docElem.scrollHeight - windowHeight, as this returns 0 (here at least). Shouldn't this be Math.max(docElem.scrollHeight - windowHeight)? This solves the issue here.

The weird thing is that the very same browser launched with another profile is not affected on another site, so this is perhaps because of a Chrome setting (flag?).

sunmockyang commented 7 years ago

Hmm not sure if I can reproduce this issue. My Chrome is at v55 now. Are you still having this issue? I can offer tips to debug if you are

rolandtoth commented 7 years ago

Interestingly the issue disappeared not long after I submitted this issue. I may have updated the browser, maybe that's why.