Created
November 5, 2013 20:31
-
-
Save michaelcarwile/7325721 to your computer and use it in GitHub Desktop.
Change the height of all list items in order to float properly with jQuery
This file contains hidden or 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
//* Originally found: http://www.nikolakis.net/2011/07/change-the-height-of-all-list-items-to-float-properly-with-jquery/ | |
/* example HTML | |
<ul class="list"> | |
<li>some information</li> | |
<li>some more information</li> | |
<li>even more information</li> | |
</ul> | |
*/ | |
/* make sure jquery is loading, then use */ | |
$(document).ready(function() { | |
var maxheight = 0; | |
$('.list li').each(function(){ | |
if (maxheight < $(this).height()) { | |
maxheight = $(this).height(); | |
} | |
}); | |
$('.list li').height(maxheight); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment