всем блокам высоту.txt 444 B

1234567891011121314151617181920212223242526272829
  1. //jQuery
  2. (function($){
  3. jQuery.fn.equalHeight = function() {
  4. console.log(this);
  5. return this.each(function(i, item){
  6. console.log(item);
  7. var children = $(item).children();
  8. var maxHeight = 50;
  9. for (var i = 0; i < children.lenght; i++) {
  10. if ( $(children[i].height() > maxHeight) ) {
  11. maxHeight = $(children[i]).height();
  12. }
  13. }
  14. children.height(maxHeight);
  15. });
  16. }
  17. }(jQuery))
  18. $('.container1')
  19. .css('color', 'red')
  20. .hide()
  21. .equalHeight()
  22. .fadeIn();