Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Data counter?

  • 17-07-2015 11:26am
    #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