simpulton / angular-photo-slider

An AngularJS photo slider built using AngularJS animate and Greensock.
93 stars 100 forks source link

Animation error #1

Closed alanloffler closed 10 years ago

alanloffler commented 10 years ago

Why the animations doesn't work with angular 1.2.9?

TrangNguyen commented 10 years ago

I have it running with angular 1.2.14 by changing addClass to beforeAddClass.

animation('.slide-animation', function () {
  return {
    beforeAddClass: function (element, className, done) {
        var scope = element.scope();

        if (className == 'ng-hide') {
          var finishPoint = element.parent().width();
          if(scope.direction !== 'next') {
            finishPoint = -finishPoint;
          }
         TweenMax.to(element, 0.5, {left: finishPoint, onComplete: done });
        }
        else {
            done();
        }
...

I hope it helps. @simpulton, thanks for the work, it's a such clean and nice slideshow.

simpulton commented 10 years ago

Thanks @TrangNguyen Will put that into today