Created
September 9, 2015 19:59
-
-
Save yozzi/259672ac023b620eb920 to your computer and use it in GitHub Desktop.
Animate Bootstrap Carousel height change
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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