Where to put the slide effect for every other image option in your code?

May 9, 2012 at 2:48 PM

Hello Everyone,

I am trying to add this option in the HTML Head section and every place I put it I am getting an syntax error.

I looked at the documentation, but it doesn't really explain where you exactly put it in the code. I am not an expert at this.

Can somebody point out to me where to put this line of code?

// Want slide effect for every other image?

if(this.current_index % 2 == 0) {

this.settings.effect = 'slide';

} else {

this.settings.effect = 'fade';

}

},

Thank you very much for your help. 

Coordinator
May 9, 2012 at 3:33 PM

Hi,
There was an error in the example code in the documentation, the animation was set to "slide" but there is not animation called "slide", only "slide-hori" and "slide-vert". This code should do the trick:

var galleries = $('.ad-gallery').adGallery({
    callbacks: {
        afterImageVisible: function() {
            // Want slide effect for every other image?
            if (this.current_index % 2 == 0) {
                this.settings.effect = 'slide-hori';
            } else {
                this.settings.effect = 'fade';
            }
        }
    }
});