malsup / cycle

jQuery Cycle Plugin - Slideshow goodness
http://jquery.malsup.com/cycle/
1.19k stars 307 forks source link

Custom transition that doesn't fade out, only fades in #161

Open oskarrough opened 10 years ago

oskarrough commented 10 years ago

I'm trying to create a custom transition that fade in the next slide on top. The curr slide should not fade out before the next is faded completely in on top. This is what I thought would work but visibility is playing me.

Any ideas? Thank you.

$.fn.cycle.transitions.fadeInOnly = {
    before: function( opts, curr, next, fwd ) {
        var css = opts.API.getSlideOpts( opts.nextSlide ).slideCss || {};

        // Rezindexes the slide deck, puts next on top
        opts.API.stackSlides( next, curr, fwd );

        opts.cssBefore = { opacity: 0, visibility: 'visible' };
        opts.animIn = { opacity: 1, visibility: 'visible' };
        opts.animOut = { opacity: 1, visibility: 'visible' };
    }
};