PaulAA 0 Share Posted June 2, 2020 Site URL: https://www.elbuhololava.com/ Site URL: https://elbuhololava.quarespace.com Password: pablobigotes 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 "pablobigotes". Thanks!! <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <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() }).animate({ countNum: countTo }, { duration: 2000, 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="163" data-desc=" Autos Lavados">0</div> <style> .counter-value { font-size: 50px; line-height:1.4em; text-align:center; padding:18px 0; } .counter-value:after { content: attr(data-desc); display:block; text-transform:uppercase; font-size: 20px; line-height:1.3em; } <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> </div> </style> Link to post
0 tuanphan 9,006 Share Posted June 9, 2020 try change duration (2000 = 2 seconds) You can send your question to my email to get detail answer. / How to Setup Password & Share URL --- Happy New Year Link to post
Question
PaulAA 0
Site URL: https://www.elbuhololava.com/
Site URL: https://elbuhololava.quarespace.com
Password: pablobigotes
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 "pablobigotes".
Thanks!!
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<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()
}).animate({
countNum: countTo
},
{
duration: 2000,
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="163" data-desc=" Autos Lavados">0</div>
<style>
.counter-value {
font-size: 50px;
line-height:1.4em;
text-align:center;
padding:18px 0;
}
.counter-value:after {
content: attr(data-desc);
display:block;
text-transform:uppercase;
font-size: 20px;
line-height:1.3em;
}
<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>
</div>
</style>
Link to post
Top Posters For This Question
1
1
Popular Days
Jun 2
1
Jun 9
1
Top Posters For This Question
PaulAA 1 post
tuanphan 1 post
Popular Days
Jun 2 2020
1 post
Jun 9 2020
1 post
1 answer to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment