Skip to content Skip to sidebar Skip to footer

How To Add A Counter Updating When You Scroll Down A Page

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?

Solution 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());
  });
});

Post a Comment for "How To Add A Counter Updating When You Scroll Down A Page"