Problem with TweenMax in AngularJS

0

I am developing a project and the animations with the TweenMax library do not work for me, I do not know why, I am waiting for your help. Below I leave the part of the code that produces the error.

This is the .html

<div id="header"class="page-header"><h1>titulo a animar</h1>

this is the .js

    window.onload = function () {
            var header = document.getElementById("header");
            TweenLite.to(header, 1, {left:"632px"});
}

Thank you very much in advance! Greetings!

    
asked by Alex00 21.06.2016 в 15:56
source

1 answer

1

I found the solution, I do not know what I would be doing wrong, but the fact is that it works like this, I put everything inside a directive in the main module:

 .directive('animacion', function() {
        return function(scope, element, attrs) {
            TweenMax.to(element, 2, {
                ease: Bounce.easeOut,
                left:"632px"
            }, 1);
        }
    });

And in the .html simply put in the element you want to animate the reference:

<h1 animacion id="header">FlyingDonkey Store</h1>
    
answered by 21.06.2016 в 17:24