Forum Discussion
[JS] SET OBJECT POSITION
These might help...
https://community.articulate.com/discussions/articulate-storyline/selecting-groups-of-elements-with-javascript-by-class
https://community.articulate.com/discussions/building-better-courses/animate-storyline-groups-with-gsap
https://community.articulate.com/discussions/building-better-courses/how-to-use-gsap-for-animation-in-storyline
https://360.articulate.com/review/content/bf35e314-c2a5-42c8-948d-4ab576847e5d/review
- RobShaw-576b1512 years agoCommunity Member
Thank you Math, I'll take a look.
- RobShaw-576b1512 years agoCommunity Member
Math,
I've been playing with the code and while I can get it to work with one group, I can't figure out how to make it work with multiple groups.
The issue I've got is that I've got buttons with states, when grouped, the whole group changes state on hover and click.
I've tried separating them out into 12 groups, and I'm trying to use the code below to move the groups, but it doesn't work.
gsap.to( allGroups[0].parentElement, { duration:0.5, x: -808});
gsap.to( allGroups[1].parentElement, { duration:0.5, x: -692});
gsap.to( allGroups[2].parentElement, { duration:0.5, x: -576});
gsap.to( allGroups[3].parentElement, { duration:0.5, x: -468});
gsap.to( allGroups[4].parentElement, { duration:0.5, x: -459});
gsap.to( allGroups[5].parentElement, { duration:0.5, x: -344});
gsap.to( allGroups[6].parentElement, { duration:0.5, x: -344});
gsap.to( allGroups[7].parentElement, { duration:0.5, x: -229});
gsap.to( allGroups[8].parentElement, { duration:0.5, x: -113});
gsap.to( allGroups[9].parentElement, { duration:0.5, x: -17});
gsap.to( allGroups[10].parentElement, { duration:0.5, x: 96});
gsap.to( allGroups[11].parentElement, { duration:0.5, x: 212});
gsap.to( allGroups[12].parentElement, { duration:0.5, x: 328});
I should point out I've got the screen divided into 10 sections, with shapes reacting to hovers to move my group horizontally back and forth across the screen.
Using just one group [0] with all the objects inside it works fine but I get the hover issue.
Can you help?
R.- MathNotermans-92 years agoCommunity Member
The group hover issue is a known Storyline bug. Articulate acknowledged that and they told ( quite some time ago ) that they are looking into that. I do hope they will fix that soon.
Why your code isnot working i cannot tell directly...maybe good to share a sample of it, then i can quickly test and see....else i need to rebuild something like this.
On a sidenote...the console is your best friend ;-) - MathNotermans-92 years agoCommunity Member
HI Rob,
Not sure what you do different, but using this old one and adding buttons into the groups...all works nicely.