Jump to content
Search Community

GSAP + AngularJS + IE or Edge = Horrible animations

Eeliya test
Moderator Tag

Go to solution Solved by Eeliya,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

This is my animation. This animation works very well in all browsers except IE and Edge. 

 

Animation does not start immediately and it happens very fast. so fast that you almost can't see it.

 

Does anyone know what could be the issue here?

'use strict';

angular
  .module('spectre')
  .animation('.slide-horizontal', SlideHorizontalAnimation)

/* ngInject */
function SlideHorizontalAnimation(TweenLite, $timeout) {
  var $animation = {};

  $animation.enter = function (element, doneFn) {
    var direction = element.attr('data-direction');

    var animationClass = 'slide-horizontal-from-right';
    if (direction === 'left') {
      animationClass = 'slide-horizontal-from-left';
    }
    element.css('display', '');
    element.addClass(animationClass);

    TweenLite.to(element[0], 0.5, {
      className: '-=' + animationClass,
      //ease: 'Power2.easeOut',
      force3D: false,
      useFrames:false,
      onComplete: function () {
        doneFn();
      }
    });
  };
  $animation.leave = function (element, doneFn) {
    var direction = element.attr('data-direction');
    var animationClass = 'slide-horizontal-from-left';
    if (direction === 'left') {
      animationClass = 'slide-horizontal-from-right';
    }

    element.removeClass(animationClass);
    TweenLite.to(element[0], 0.4, {
      className: '+=' + animationClass,
      force3D: false,
      useFrames:false,
      //ease: 'Power2.easeOut',
      onComplete: doneFn
    });
  };

  return $animation;
}

See the Pen dXRpaV by eeliya (@eeliya) on CodePen

Link to comment
Share on other sites

Interesting. Do you know why exactly? What's the conflict? I'm struggling to figure out how/why anything would get in the way of GSAP performing well. Does angular-material try to control the same properties during the animation or something (wrestling for control)? 

  • Like 1
Link to comment
Share on other sites

There is no reason for GSAP not to work. Have you tried tweening something simple, like x or opacity. This looks really suspect.

element.css('display', '');
element.addClass(animationClass);

TweenLite.to(element[0], 0.5, {
  className: '-=' + animationClass,
  //ease: 'Power2.easeOut',
  force3D: false,
  useFrames:false,
  onComplete: function () {
    doneFn();
  }
});
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...