jquery.counterup icon indicating copy to clipboard operation
jquery.counterup copied to clipboard

Start after animation is complete.

Open Bluxart opened this issue 8 years ago • 0 comments

Hi, great plugins works perfectly but I have a little problem, if I combined your plugin with animation on scroll.

I need start the counterUp when the animation on scroll is complete and work but the counter display the final value ( ex. 1500 ) for all duration of animation and when the animation is complete the counter start the animation for the value from 0 to 1500.

Only solution is hide the text with css or store the value with js?

This is the sample code:

$('.az-counter').each(function(){

    var counter = $(this),
        wrap_parent = counter.closest('.az-content-element-wrapper');

    var wait_val = '',
        wait_ani_speed = wrap_parent.data('animation-speed'),
        wait_ani_delay = wrap_parent.data('animation-delay');

    if ( wait_ani_speed == 'default') { 
        wait_val = 1000;
    } else {
        wait_val = ( wait_ani_speed + wait_ani_delay );
    }

    if ( ! wrap_parent.hasClass( 'animate-content' ) ) {

        counter.counterUp();

    } else {

        wrap_parent.delay(wait_val).queue(function(){

            var that = $(this);
            setTimeout(function(){
                counter.counterUp();
                that.dequeue();
            }, 100);

        });

    }

});

Thanks for your time.

Bluxart avatar May 11 '16 20:05 Bluxart