Guest User

Equal height Funktion für Bootstrap3 Grid mit Grid Elements

a guest
Oct 17th, 2014
191
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Equal height Funktion für Bootstrap Gridelements
  2. // (c) Andreas Becker <andreas.becker@websedit.de>
  3. equalheight = function(){
  4.     var kids = 0,
  5.             colDivs = new Array(),
  6.             maxHeight = 0;
  7.     // Klasse .equal-height suchen
  8.     $('.equal-height').each(function() {
  9.         kids = $(this).children();
  10.         // alle Kindelemente davon in Array schreiben
  11.         kids.each(function() {
  12.             colDivs.push($(this).height());
  13.         });
  14.         // größte Höhe der Kinder ermitteln
  15.         maxHeight = Math.max.apply(Math, colDivs);
  16.         // alle Kinder mit entsprechender Höhe versehen
  17.         $(this).children().height(maxHeight);
  18.     });
  19. }
  20. // Wenn Seite geladen
  21. $(window).load(function() {
  22.     equalheight();
  23. });
  24. // Wenn Seitengröße angepasst
  25. $(window).resize(function(){
  26.     equalheight();
  27. });
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×