Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Start after animation is complete. #4

Open
Bluxart opened this issue May 11, 2016 · 0 comments
Open

Start after animation is complete. #4

Bluxart opened this issue May 11, 2016 · 0 comments
Labels

Comments

@Bluxart
Copy link

Bluxart commented May 11, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants