How can I add a counter updating when you scroll down a page? I like the effect that chartbeat has. What jQuery should I use to be able to achieve that?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There is scrollTop() function. You bind event handler to 'scroll' event on document and put the value in place you want.
$(document).ready(function() {
$(this).bind('scroll', function() {
console.log($(this).scrollTop());
});
});