Last active
August 29, 2015 14:13
-
-
Save ChaseIndustries/077b509db436abe9f9d2 to your computer and use it in GitHub Desktop.
Bootstrap - Set all bootstrap slides to the same height on load (add this to your window onload)
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
//set the slides to all the same height | |
if($(".carousel").length){ | |
var maxHeight,items,numSlides; | |
$(".carousel").each(function(){ | |
maxHeight = 0, | |
items = $(this).find(".item"), | |
numSlides = items.length; | |
items.each(function(i){ | |
var h = $(this).height(); | |
if(h > maxHeight){ | |
maxHeight = h; | |
} | |
if(i == numSlides-1){ | |
items.height(maxHeight); | |
} | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment