Coder Social home page Coder Social logo

tombruijn / counter.js Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 13.0 100 KB

A simple number counter in JavaScript as a jQuery plugin.

Home Page: tombruijn.github.io/counter.js

License: MIT License

Ruby 3.91% CoffeeScript 14.05% JavaScript 66.39% Makefile 0.53% HTML 15.12%

counter.js's People

Contributors

tombruijn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

counter.js's Issues

Feature Request: Redirect on counter end

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.

Documentationm

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 :/

Option to not start if already run once

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.

Floating 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.

number formatting

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;
  }
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.