tombruijn / counter.js Goto Github PK
View Code? Open in Web Editor NEWA simple number counter in JavaScript as a jQuery plugin.
Home Page: tombruijn.github.io/counter.js
License: MIT License
A simple number counter in JavaScript as a jQuery plugin.
Home Page: tombruijn.github.io/counter.js
License: MIT License
Hi and thank you for sharing your work with us!
Feature that would be really kool: at end of count down forward to a URL.
Can of course use the meta tag to do this, would be nice for have built in.
Thanks again.
Hi.
how i can reuse counter with new parameters (countFrom and countTo)?
Got into this problem when implementing it. It triggered on scroll and once run it would still trigger again after scrolling. A simple check on the contents of the element and the countTo
value would help prevent secondary runs.
Hi,
I need to know, how to increment countTo value +50 automatically after some interval.
<div class="number" data-counter-to="123">0</div>
$(".number").counter()
Result:
# => <div class="number" data-counter-to="123">123</div>
Just a little suggestion, on the homepage of the github, add a little explanation of how to start the counter if autoStart is set to false. It took me ages to work it out :/
See issue #5
Allow custom function to be set to format the number to be set on the element.
Example code
$("#counter").counter({
numberFormatter: function(number) {
return "$ " + number;
}
});
Is there any reason not to use:
givenNumber = parseFloat(this.element.innerHTML);
instead of:
givenNumber = parseInt(this.element.innerHTML);
The parseInt just seems to limit the usability of the plugin.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.