Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // JavaScript Document
- // make sure the $ is pointing to JQuery and not some other library
- (function($){
- // add a new method to JQuery
- $.fn.equalHeight = function() {
- // find the tallest height in the collection
- // that was passed in (.container)
- tallest = 0;
- this.each(function(){
- thisHeight = $(this).height();
- if( thisHeight > tallest)
- tallest = thisHeight;
- });
- // set each items height to use the tallest value found
- this.each(function(){
- $(this).height(tallest);
- });
- }
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement