Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Data counter?

  • 17-07-2015 12:26PM
    #1
    Registered Users, Registered Users 2 Posts: 1,298 ✭✭✭


    Hi Everyone,

    A client is looking for one of these elements on their new website. Not sure what they're called is it data counters? Have a fairly good idea on how to write it out from scratch but if I can find a pre existing plugin i'd rather go down that route.

    355567.png


Comments

  • Registered Users, Registered Users 2 Posts: 262 ✭✭Banta


    Found the github of one online, and then saw a CodePen of the same plugin here: http://codepen.io/chumpyy/pen/opgxC

    I reckon that should do what you're looking for. Looks good, with plenty of configurable options.


  • Registered Users, Registered Users 2 Posts: 1,298 ✭✭✭off.the.walls


    Perfect thanking you!


  • Registered Users, Registered Users 2 Posts: 1,298 ✭✭✭off.the.walls


    http://stackoverflow.com/questions/2540277/jquery-counter-to-count-up-to-a-target-number also found this incase anyone else is stuck. Tis fairly handy to use!


  • Registered Users, Registered Users 2 Posts: 262 ✭✭Banta


    The most upped answer is the same guy that I linked to ha ha!!! Only when reading the code did I think "Hmm, this looks familiar" then saw the posters name.

    You know I'm just going to have a find a use for this now. Seems like a pretty nifty bit of script.


  • Registered Users, Registered Users 2 Posts: 1,298 ✭✭✭off.the.walls


    Banta wrote: »
    The most upped answer is the same guy that I linked to ha ha!!! Only when reading the code did I think "Hmm, this looks familiar" then saw the posters name.

    You know I'm just going to have a find a use for this now. Seems like a pretty nifty bit of script.

    That one is fairly handy also found this and it makes it alot easier, you don't need data-from to or speed in your html element. Just put the value into the HTML and this script animates up to it. [HTML]var counter = $('#counter').offset().top;

    $(window).scroll(startCount);
    function startCount() {
    if ($(window).scrollTop() > counter) {
    $(window).off("scroll", startCount);
    $('.timer').each(function () {
    var $this = $(this);
    jQuery({ Counter: 0 }).animate({ Counter: $this.text() }, {
    duration: 2000,
    easing: 'swing',
    step: function () {
    $this.text(Math.ceil(this.Counter));
    }
    });
    });
    }
    }[/HTML]


  • Advertisement
Advertisement