Forum Discussion
Expand and Contract a graphic?
The console is your best friend ( next to me ofcourse ;-) ).. You can click the error in red and it will show the line your typo is in. Do share a .storyline... makes it way easier to debug.
If clicking the error doesnot show the user.js with the line giving the error... open up the tab 'Application' in the helpers window... then you can select/open user.js and find the line giving the error.
Syntax is really important in Javascript. 1 comma or bracket too much and it will fail.
Do check my sample to find the differences.
What i see in your typed code..it might just be this: x: 100vw
that should be x: "100vw"
And noticing a comma missing after theObject..
So instead of:gsap.to(theObject {scale: 0.66, x: 100vw, duration: 1.5, ease: "back"});
this:gsap.to(theObject, {scale: 0.66, x: "100vw", duration: 1.5, ease: "back"});
Try to understand the syntax.
Borrowed from the GSAP site.
A method can be to...from...fromTo, set or many more..
the target(s) are your element(s) you want animated..
Do notice the comma and brackets. They really are necessary.