]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Orbit: remove `.animate-in` late (just before setting `.active`) 4909/head
authorDaniel Hahler <git@thequod.de>
Sun, 6 Apr 2014 22:24:29 +0000 (00:24 +0200)
committerDaniel Hahler <git@thequod.de>
Sun, 6 Apr 2014 22:28:49 +0000 (00:28 +0200)
This fixes the animations, especially with `variable_height` handling,
where the slide content would slide in, but then disappear until the
final animation of the containers height gets done / is finished.

js/foundation/foundation.orbit.js

index d52c27427576f6fb7eb5776f1b9e9e0df5629c26..b04cc9d6621131ec455ba18327599cd2346bb8b3 100644 (file)
         var unlock = function() {
           if (start_timer === true) {self.cache.timer.restart();}
           self.update_slide_number(idx);
+          // Remove "animate-in" class as late as possible to avoid "flickering" (especially with variable_height).
+          next.removeClass("animate-in");
           next.addClass(settings.active_slide_class);
           self.update_active_link(next_idx);
           slides_container.trigger('after-slide-change.fndtn.orbit',[{slide_number: idx, total_slides: slides.length}]);
         next.on(animation_end, function(e){
           next.unbind(animation_end);
           current.removeClass("active animate-out");
-          next.removeClass("animate-in");
           container.children().css({
             "transform":"",
             "-ms-transform":"",
       } else {
         setTimeout(function(){
           current.removeClass("active animate-out");
-          next.removeClass("animate-in");
           container.children().css({
             "transform":"",
             "-ms-transform":"",
         prev.on(animation_end, function(e){
           prev.unbind(animation_end);
           current.removeClass("active animate-out");
-          prev.removeClass("animate-in");
           container.children().css({
             "transform":"",
             "-ms-transform":"",
       } else {
         setTimeout(function(){
           current.removeClass("active animate-out");
-          prev.removeClass("animate-in");
           container.children().css({
             "transform":"",
             "-ms-transform":"",