[sOLVED]
IMPORTANT: When using GS with require.js dont override the GS variables like that:
define(['ScrollToPlugin', 'TweenLite', 'TimelineLite'],
function(ScrollToPlugin, TweenLite, TimelineLite) {
// your code here
})
Hello,
I am doing something weird probably because I cant add Tween to Timeline.
var tw = TweenLite.to(window, 0.7, {scrollTo:{y: 300}, ease:Power3.easeInOut});
console.log(tw);
var tl = new TimelineLite();
tl.add( tw );
and the same when testing this way:
var tl = new TimelineLite();
tl.add( TweenLite.to(window, 0.7, {scrollTo:{y: 300}, ease:Power3.easeInOut}) );
Both ways I see the error:
Uncaught Cannot add [object Object] into the timeline; it is not a tween, timeline, function, or string.
The output from console.log(tw) begins with:
Object {vars: Object, _totalDuration: 0.7, _duration: 0.7, _delay:0, _timeScale: 1…}
_active: false
_delay: 0
_duration: 0.7
_ease: Object
_easePower: 3
_easeType: 3
_firstPT: Object
It looks like a tween anyway.. What I am doing wrong?
Same code in jsFiddle is working fine. Pls. help with a hint.
EDIT: I am loading all .js files with require.js (AMD loader). What is the correct way of loading GS plugins with require.js shim?