Code:
// jQuery Ken Burns Effect Script (c)2013 John Davenport Scheuer
// as first seen in http://www.dynamicdrive.com/forums/
// username: jscheuer1 - This Notice Must Remain for Legal Use
(function($){
burns = [
{//0
setup: {width: '136%', height: 'auto', position: 'absolute', top: 0, left: 0},
ani: {width: '100%'}
},
{//1
setup: {width: '136%', height: 'auto', position: 'absolute', top: '-36%', left: 0},
ani: {width: '100%', top: 0}
},
{//2
setup: {width: '136%', height: 'auto', position: 'absolute', top: 0, left: '-36%'},
ani: {width: '100%', left: 0}
},
{//3
setup: {width: '136%', height: 'auto', position: 'absolute', top: '-36%', left: '-15%'},
ani: {width: '100%', top: 0, left: 0}
},
{//4
setup: {width: '100%', height: '100%', position: 'absolute', top: 0, left: 0},
ani: {width: '136%', height: '136%', top: '-15%'}
},
{//5
setup: {width: '115%', height: '115%', position: 'absolute', bottom: 0, left: '-15%'},
ani: {width: '136%', height: '136%', bottom: '-15%', left: 0}
},
{//6
setup: {width: '136%', height: 'auto', position: 'absolute', top: '-15%', left: 0},
ani: {left: '-36%'}
}
];
$.fn.kenburns = function(burn, duration){
this.css(burns[burn].setup).animate(burns[burn].ani, {queue: false, easing: 'linear', duration: duration});
};
})(jQuery);
Some of the "burns" are pretty similar, as I was fine tuning with some of them, others can be added. I worked this out for use with The Ultimate Fade-in Slideshow, and it's pretty close to what the WOW slider does, with much less code and no canvas tag. Things aren't perfected yet (they almost never are with me - but I see some things this still really needs), but here's a demo:
Bookmarks