Forum Discussion
Have an Open/Close Effect with Layers
I want information (slide layer) to show or hide in a slide when the user continuously clicks a button the slide (an open/close effect). I was able to create triggers to only once "open and close" the layer. Once I closed the layer after opening, I could not open again.
My work:
- Created a trigger: Show Layer X, when the user clicks ButtonX, If the state of ButtonX = Normal, and the state of ButtonX = Selected. (I also attempted this with both states as selected)
- Created a trigger: Hide Layer X, When the user clicks ButtonX, If the state of ButtonX = Visited.
I attempted several states for the button but the only result I get is being able to show and hide the layer. I am unable to have it show again.
Thanks
- MariaCSStaff
Hi, Steven.
Thank you for reaching out!
My suggestion is to toggle a True/False variable when the user clicks the button, and use that value as a condition of showing or hiding the layer:
Example:
I hope this helps!
- PhilMayorSuper Hero
I would add a hide trigger before the show trigger
Depending on what you are doing, you could also add a selected state to the button and use the selected state as a trigger. Example here.
Of course, using variables gives you more granular control if you add more complexity to the interaction.
- GerryMcAteer-86Community Member
Hi Steven, I did something similar using layers and hotspots here is a link to the post where you can also download the SL file to see how I did it. View
- JohnBishop-6aa8Community Member
Nice Gerry, genius move putting the rollover in the layer, really simplified this for me. I was stuck figuring out how to do this with rollovers on the main layer. They were not needed. Much better this way! Thanks!
- ViacheslavSopilCommunity Member
I came up with these triggers and it works fine. (I have visited states for objects as well)