]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Orbit: `min-height` for slides_container (instead of `height`) 4908/head
authorDaniel Hahler <git@thequod.de>
Sun, 6 Apr 2014 18:25:15 +0000 (20:25 +0200)
committerDaniel Hahler <git@thequod.de>
Sun, 6 Apr 2014 22:15:17 +0000 (00:15 +0200)
Using `min-height` (with `position:relative`) allows the slide container
to get expanded, in case it contains elements of variable height (e.g.
accordions).

js/foundation/foundation.orbit.js
scss/foundation/components/_orbit.scss

index d52c27427576f6fb7eb5776f1b9e9e0df5629c26..ebc71ae9849959e9aad5c98133eba12916a9b035 100644 (file)
           
         };
         if (slides_container.height() != next.height() && settings.variable_height) {
-          slides_container.animate({'height': next.height()}, 250, 'linear', unlock);
+          slides_container.animate({'min-height': next.height()}, 250, 'linear', unlock);
         } else {
           unlock();
         }
       };
 
       if (next.height() > slides_container.height() && settings.variable_height) {
-        slides_container.animate({'height': next.height()}, 250, 'linear', start_animation);
+        slides_container.animate({'min-height': next.height()}, 250, 'linear', start_animation);
       } else {
         start_animation();
       }
           if ($(this).height() > h) { h = $(this).height(); }
         });
       }
-      slides_container.height(h);
+      slides_container.css('minHeight', String(h)+'px');
     };
 
     self.create_timer = function() {
index 22377ad5b57fa7eb8441c916abf105ec00f7b94b..7e988d179c0d385c2f9d01db98ffe22f17bbfeda 100644 (file)
@@ -190,6 +190,8 @@ $orbit-timer-hide-for-small: true !default;
 
           &.active {
             opacity: 1;
+            // "relative" positioning is required for variable height of children.
+            position:relative;
             top: 0;
             left: 0;
             @include translate3d(0,0,0);