Jump to content

Custome counter

Recommended Posts

Site URL: https://elbuhololava.quarespace.com

Im using the following code.

The intentions is to show a kind of visits to the page. But i want it to increase over time, lets say, add 5 every day. 

can you help me?? 

www.elbuhololava.quarespace.com Password "elbuho".




<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
var a = 0;
$(window).scroll(function() {

  var oTop = $('#counter').offset().top - window.innerHeight;
  if (a == 0 && $(window).scrollTop() > oTop) {
    $('.counter-value').each(function() {
      var $this = $(this),
        countTo = $this.attr('data-count');
        countNum: $this.text()
          countNum: countTo
          duration: 2000,
          easing: 'swing',
          step: function() {
          complete: function() {
    a = 1;
<div id="counter">
    <div class="sqs-col sqs-col-4 counter-value" data-count="163" data-desc=" Autos Lavados">0</div>
 .counter-value { 
    font-size: 50px;
   padding:18px 0;
  .counter-value:after {
   content: attr(data-desc);
    font-size: 20px;

<div id="counter" data-startdate="31/12/2010">
  <div class="sqs-col sqs-col-4 counter-value" data-dailyincrement="2" data-count="200" data-desc=" Autos Lavados">0</div>

Link to comment
  • 2 weeks later...
  • Replies 5
  • Views 638
  • Created
  • Last Reply


This topic is now archived and is closed to further replies.

  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.