Where to start if I want to build a complete custom transition for the Cycle plugin ?
Hi,
I'm currently trying to create a complete custom transition for the awesome jQuery Cycle plugin. Basically, what I want to achieve is kind if a lightbox like transition effect... You know, the images wraper scales itself based on the current image width and height and scales itself again when you go to next or prev image.
Ok I have 2 questions:
1) I can see in the source of Cycle, at the end there is:
$.fn.cycle.transitions = { ... } and inside there is the fade transition set up. Do I need to create my new transition here?
2) What (basically) mean these lines of code:
opts.before.push(function(curr,next,opts) {
$.fn.cycle.commonReset(curr,next,opts);
opts.cssBefore.opacity = 0;
});
which are inside of:
$.fn.cycle.transitions = {
fade: function($cont, $slides, opts) {
$slides.not(':eq('+opts.currSlide+')').css('opacity',0);
opts.before.push(function(curr,next,opts) {
$.fn.cycle.commonReset(curr,next,opts);
opts.cssBefore.opacity = 0;
});
opts.animIn = { opacity: 1 };
opts.animOut = { opacity: 0 };
opts.cssBefore = { top: 0, left: 0 };
}
};
Thx a lot
Regards
Julien