Skip to content

Instantly share code, notes, and snippets.

@yozzi
Created September 9, 2015 19:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yozzi/259672ac023b620eb920 to your computer and use it in GitHub Desktop.
Save yozzi/259672ac023b620eb920 to your computer and use it in GitHub Desktop.
Animate Bootstrap Carousel height change
//Animate carousel height change
//Désactivé, ça déconne dans le modal : le premier slide a une hauteur de 0px
function bsCarouselAnimHeight()
{
$('.carousel').carousel({
interval: 5000
}).on('slide.bs.carousel', function (e)
{
var nextH = $(e.relatedTarget).height();
$(this).find('.active.item').parent().animate({ height: nextH }, 500);
});
}
bsCarouselAnimHeight();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment