jquery - How to set a smooth transition for nearly the same images? -
i have series of 3 images trow unordered list. images same , small piece of image changing. way 'movie' kinda effect.
i use jquery cycle plugin.
i run problem can't seem figure out how set transition smooth images blend another. 1 image fades out , other fades in... , results in flash between images...
can share example of smooth blending of same images?
update:
i've modified transition barely noticably fading out should each slide fades in. may need change speed, delay, and/or timeout properties match exactly trying accomplish.
http://jsfiddle.net/lucuma/tcrcj/12/
transition:
$.fn.cycle.transitions.smooth = function($cont, $slides, opts) { $slides.not(':eq(' + opts.currslide + ')').css('opacity', .99); opts.before.push(function(curr, next, opts) { $.fn.cycle.commonreset(curr, next, opts); opts.cssbefore.opacity = 0; }); opts.animin = { opacity: 1 }; opts.animout = { opacity: .99 }; opts.cssbefore = { top: 0, left: 0 }; };
original:
the closest can super smooth transition this:
$('#slideshow').cycle({fx:'fade', continuous:1, timeout:0, easein: 'linear', easeout: 'linear'});
demo: http://jsfiddle.net/lucuma/tcrcj/6/
this works great horizontal/vertical fx's.
round 2:
i've updated jsfiddle new custom fx called smooth:
http://jsfiddle.net/lucuma/tcrcj/12/
you may need play around speed:
$.fn.cycle.transitions.smooth = function($cont, $slides, opts) { $slides.not(':eq(' + opts.currslide + ')').css('opacity', .99); opts.before.push(function(curr, next, opts) { $.fn.cycle.commonreset(curr, next, opts); opts.cssbefore.opacity = 0; }); opts.animin = { opacity: 1 }; opts.animout = { opacity: .99 }; opts.cssbefore = { top: 0, left: 0 }; }; $('#slideshow').cycle({ fx: 'smooth', continuous: 1, speed: 300, easein: 'linear', easeout: 'linear' });
Comments
Post a Comment