Created
July 27, 2009 22:06
-
-
Save firebelly/156774 to your computer and use it in GitHub Desktop.
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
(function($){ | |
//meant to handle making floated lists that have elements of different heights | |
//display in nicely aligned columns like a table | |
$.fn.equalizeColumns = function() { | |
var prev_els_position = 0; | |
return this.each(function(i, el){ | |
$(el).children("li").each(function(i, el){ | |
if($(el).is(":floating")){ | |
if($(el).position().top > prev_els_position) | |
$(el).css({clear: "left"}); | |
} | |
prev_els_position = $(el).position().top; | |
}); | |
}); | |
} | |
})(jQuery) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment