Advertisement
nickyb713

Untitled

Apr 23rd, 2011
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. // JavaScript Document
  2. // make sure the $ is pointing to JQuery and not some other library
  3. (function($){
  4. // add a new method to JQuery
  5.  
  6. $.fn.equalHeight = function() {
  7. // find the tallest height in the collection
  8. // that was passed in (.container)
  9. tallest = 0;
  10. this.each(function(){
  11. thisHeight = $(this).height();
  12. if( thisHeight > tallest)
  13. tallest = thisHeight;
  14. });
  15.  
  16. // set each items height to use the tallest value found
  17. this.each(function(){
  18. $(this).height(tallest);
  19. });
  20. }
  21. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement