Skip to content

Instantly share code, notes, and snippets.

@jaredhabeck
Created April 16, 2013 18:55
Show Gist options
  • Save jaredhabeck/5398553 to your computer and use it in GitHub Desktop.
Save jaredhabeck/5398553 to your computer and use it in GitHub Desktop.
$('#coverflip').jcoverflip({
current: flipItemCount,
beforeCss: function( el, container, offset ){
console.log(container);
return [
$.jcoverflip.animationElement( el, { 'transform':'skew(0deg, 30deg)', left: ( container.width( )/2 - 280 - 190 *offset )+'px', bottom: '60px' }, {}),
$.jcoverflip.animationElement( el.find( 'img' ), { opacity: 0.7, width: '175px', height: '175px' }, {} )
];
},
afterCss: function( el, container, offset ){
return [
$.jcoverflip.animationElement( el, { 'transform':'skew(30deg, 0deg)', left: ( container.width( )/2 + 180 + 190 *offset )+'px', bottom: '60px' }, { } ),
$.jcoverflip.animationElement( el.find( 'img' ), { opacity: 0.7, width: '175px', height: '175px' }, {} )
];
},
currentCss: function( el, container ){
return [
$.jcoverflip.animationElement( el, { 'transform':'none', left: ( container.width( )/2 - 100 )+'px', bottom: '10px' }, { } ),
$.jcoverflip.animationElement( el.find( 'img' ), { opacity: 1.0, width: '280px', height: '280px' }, { } )
];
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment