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

Kerst

Member
  • Content Count

    8
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @paul2009 thanks very much for the quick reply. I'll get it fixed.
  2. @paul2009 would you be able to help? I've seen other posts from you about this code snippet. Thanks in advance
  3. Site URL: https://emu-orange-ea7f.squarespace.com/impact I'm trying to create an animated number counter. I've found some code on this forum (see below). It's working fine on desktop but isn't loading on mobile. It appears to be correctly written for ajax so I'm at a loss as to why it isn't working. Can anyone help? <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script> var a = 0; $(window).load(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() }).animate({ countNum: countTo }, { duration: 3000, easing: 'swing', step: function() { $this.text(Math.floor(this.countNum)); }, complete: function() { $(this).format({format:"#,###", locale:"uk"}); $this.text(this.countNum); } }); }); a = 1; } }); </script> <div id="counter"> <div class="sqs-col sqs-col-4 counter-value" data-count="30000" data-desc="Young people">0</div> <div class="sqs-col sqs-col-4 counter-value" data-count="80000" data-desc="Problems">0</div> <div class="sqs-col sqs-col-4 counter-value" data-count="250000" data-desc="Solutions">0</div> </div>
  4. Site URL: https://www.meetwo.co.uk/impact-test I'm trying to add animated numbers to my site. When the page loads the numbers will automatically count up to a maximum over a specified duration. I've found a bit of code that has been mentioned elsewhere on the forum and that's working well (see code below). Now I would like to improve this by adding a comma separation in the numbers eg 23,500. Stack Overflow offer some methods for adding commas but I can't get any of them to work. Any help would be much appreciate. Thanks Main code <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script> var a = 0; $(window).load(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() }).animate({ countNum: countTo }, { duration: 3000, easing: 'swing', step: function() { $this.text(Math.floor(this.countNum)); }, complete: function() { $this.text(this.countNum); } }); }); a = 1; } }); </script> <div id="counter"> <div class="sqs-col sqs-col-4 counter-value" data-count="30000" data-desc="Young people">0</div> <div class="sqs-col sqs-col-4 counter-value" data-count="80000" data-desc="Problems">0</div> <div class="sqs-col sqs-col-4 counter-value" data-count="250000" data-desc="Solutions">0</div> </div>
  5. Last week an employee maliciously deleted a substantial amount of content from our site (individual items rather than pages). We are frustrated and disappointed to find that Squarespace doesn't provide any backup facility. We've loved using Squarespace but the website is due for an overhaul in the next few months and the inability to back up content is likely to push us towards finding another solution.
  6. I'd like to use a down arrow for Adirondack. I've tried the code above but it doesn't work. Is there an alternative that would?
  7. I'd like to use a down arrow for Adirondack. I've tried the code above but it doesn't work. Is there an alternative that would?
×
×
  • Create New...