jQuery Supersized AfterAnimation

2019-05-31 22:33发布

问题:

I am trying to use the afterAnimation event on the SuperSized jQuery plugin (docs:http://buildinternet.com/project/supersized/docs.html#theme-after) but cannot get it to fire.

Code (sample):

$.supersized({              
    //Functionality
    slideshow               :   1,
    autoplay                :   1,
    start_slide             :   1,
    stop_loop               :   0,
    random                  :   0,  
    slide_interval          :   3000,
    transition              :   6,
    transition_speed        :   1200,

    // .. removed for clarity

    //Theme Options            
    progress_bar            :   1,  
    mouse_scrub             :   0,
    // This is where i'm trying to call afterAnimation()
    afterAnimation          : function() {
        console.log('blech');
    }}
});

Any guidance would be greatly appreciated!

回答1:

Turns out that I was pretty close.

After the initialization of supersized, you can do this:

theme.afterAnimation = function() {
    console.log('animate');
};