-1

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?

Kate Gregory
  • 18,808
  • 8
  • 56
  • 85
mikker
  • 5
  • 4

1 Answers1

0

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());
  });
});
Pavel Staselun
  • 1,970
  • 1
  • 12
  • 24
  • So, jQuery answers are acceptable? For due reference it might be best to specify that in your question, or the tags to your question. – David Thomas Jul 31 '12 at 10:12