Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Custome counter


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>

Share this post

Link to post

5 answers to this question

Recommended Posts

  • 0

try edit duration

with 2000 = 2 seconds

You can send your question to my email to get faster answer. / How to Setup Password & Share URL 

-- I'm Tuan. I work for a non-profit project (promote the establishment of free libraries). I check the forum once or twice a day to help out the community. If you don't see me answering your question, you can send it to the email above. There are so many questions every day so I can't answer them all at once, I will try to answer them in the next few days.

Share this post

Link to post
  • 0
10 minutes ago, PaulAA said:

Didnt work, goes back to zero. any other way?

@PaulAA you won't be able to save a visitor count unless you save that count somewhere, either with a cookie or through localStorage.

Philadelphia, PA

Available for hire

Beyond Copy/Paste: Learn CSS for Squarespace Workshop

Chat/Message on FB Messenger for quickest responsehttps://m.me/dejaegherryan


Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

  • Create New...