]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
orbit: add event beforeslidechange
authormaks feltrin <pine3ree@gmail.com>
Tue, 30 Aug 2016 16:33:05 +0000 (18:33 +0200)
committerGitHub <noreply@github.com>
Tue, 30 Aug 2016 16:33:05 +0000 (18:33 +0200)
I use this event to smoothly resize the orbit container for carousels with images of different heights

js/foundation.orbit.js

index d12f62f6cc94e299a653f70977c1dbb1e5ca3ed8..80116256ee5b33bafb41a8dea3c57aedb7b53296 100644 (file)
@@ -268,6 +268,8 @@ class Orbit {
     }
 
     if ($newSlide.length) {
+      this.$element.trigger('beforeslidechange.zf.orbit', [$curSlide, $newSlide]);
+      
       if (this.options.bullets) {
         idx = idx || this.$slides.index($newSlide); //grab index to update bullets
         this._updateBullets(idx);