]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: remove position reset of Orbit slides preventing the "full-absolute" new behavior 11107/head
authorNicolas Coden <nicolas@ncoden.fr>
Wed, 11 Apr 2018 21:01:22 +0000 (23:01 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Wed, 11 Apr 2018 21:01:22 +0000 (23:01 +0200)
All Orbit slides should always have an `absolute` positioning to prevent jumping Orbit slider (see #11107). The `'position': 'relative'` reset is no longer necessary here and break the Orbit behavior as inline styles overrides `.orbit-slide` class styles.

See:
* https://github.com/zurb/foundation-sites/pull/11107/commits/dbdae96312bcccd0820d8ee43c088d5d6a1fab14
* https://github.com/zurb/foundation-sites/pull/11107

js/foundation.orbit.js

index 8901c6b4e31b15123bddf1f55f4c6126970cdcb9..41ef15f27dda84f54d800ecbe940a6562b90557c 100644 (file)
@@ -149,8 +149,9 @@ class Orbit extends Plugin {
       temp = this.getBoundingClientRect().height;
       $(this).attr('data-slide', counter);
 
-      if (!/mui/g.test($(this)[0].className) && _this.$slides.filter('.is-active')[0] !== _this.$slides.eq(counter)[0]) {//if not the active slide, set css position and display property
-        $(this).css({'position': 'relative', 'display': 'none'});
+      // hide all slides but the active one
+      if (!/mui/g.test($(this)[0].className) && _this.$slides.filter('.is-active')[0] !== _this.$slides.eq(counter)[0]) {
+        $(this).css({'display': 'none'});
       }
       max = temp > max ? temp : max;
       counter++;