I'm trying to do a real-time counter, but it's not going to count by a click event or something like that. I just want that if the user updates the page or leave the site, when the user comes it doesn't reset the counter and it keeps counting while the user is absent I have created a counter in JavaScript with the help of CounterUp.js to display it in my Laravel view. I just want to show this counter in real time.
I just want to see if I somebody could recommend me some tutorial or a way to solve it.
This is the code of the counter to be more specific
<script src=""></script>
<script>
var num = $('.price').attr('profit'); //end count
var options = {
useEasing: true,
useGrouping: true,
separator: ',',
decimal: '.',
};
$('.countupthis').each(function() {
var price = $(this).attr('profit'); //end count
var text = $(this).text();
if (text === "") {
text = 0;
}
var counts = new CountUp(this, text, price, 6, 1.5, options);
counts.start();
});
</script>
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire