I need to create a toggle button which opens a layer in a corner of the screen. I then want to use the same button to close the layer. How would I make a toggle button? I don't seem to be able to find any other thread on this topic.
How much stuff is on the layer? The easiest way to get that toggling may be to move the content from the layer into the Selected state of the button. A button with a Selected state will automatically toggle between Normal and Selected when it's clicked, so you wouldn't need any triggers (or layers).
Glad to see that Michael jumped in with the toggle-variable solution. With that option, be sure to use a unique variable for each slide. Otherwise, the True/False values could get mixed up.
Other options:
Put a copy of the button on the layer, and give it a trigger to hide the layer. (If it's in the same position, the user won't know it's a different button.)
or
Cover the base button. Use a separate button on the layer that specifically indicates it's for closing that content.
I followed your suggestion of moving the content to the Selected state and it worked great, thank you!
I then tried to put my 3 buttons in a button set, but now they are no longer toggling back to the Normal state when the same button is clicked. Is there a way to get around that?
I then tried to put my 3 buttons in a button set, but now they are no longer toggling back to the Normal state when the same button is clicked. Is there a way to get around that?
The point of a button set is to require the user to make a selection—and only 1 selection. For example, to indicate an answer to a question or to choose an avatar.
However, that means that to deselect a button in the set, the user has to select another button in the set. Or some other trigger has to change the button back to Normal.
Depending on your situation, you could try one of the following:
Remove the button set. (That works if no answer is required or if more than one item can be selected.)
Add a button to the set that's labeled something like "Clear selection." (Sure, technically, they'd be selecting that button. But that would deselect the other buttons with actual choices.)
Okay, I'm going to try a couple things to see if I can make it do what I want it to without the button set. If I end up not being able to thwart the issue I'm envisioning, I may have to come back with a file attachment for more expert help!
If you can't get it to work, I suggest you start a new discussion to post the file. That's more likely to be seen than yet another entry on an older post. (The Forum doesn't actually tag people. And one only gets notifications if they subscribe to a given post.) Having the particular issue in a separate post would probably be more helpful for those searching the Forum in the future.
11 Replies
How much stuff is on the layer? The easiest way to get that toggling may be to move the content from the layer into the Selected state of the button. A button with a Selected state will automatically toggle between Normal and Selected when it's clicked, so you wouldn't need any triggers (or layers).
Thanks Judy. If it was a simple layer, that would be a great simple solution (I'll retain tour tip for another occasion).
Unfortunately, it's a complex layer that requires fiddling with new content (text and avatar) on each slide, so I'm hoping to retain the layer format.
See attached a quick example, using a True/False variable that is toggles whenever the button is clicked.
Glad to see that Michael jumped in with the toggle-variable solution. With that option, be sure to use a unique variable for each slide. Otherwise, the True/False values could get mixed up.
Other options:
or
Many thanks Michael. Nice and easy to follow and just what I was wanting.
This post was removed by the author
Thanks for the tip, Judy
Judy,
I followed your suggestion of moving the content to the Selected state and it worked great, thank you!
I then tried to put my 3 buttons in a button set, but now they are no longer toggling back to the Normal state when the same button is clicked. Is there a way to get around that?
The point of a button set is to require the user to make a selection—and only 1 selection. For example, to indicate an answer to a question or to choose an avatar.
However, that means that to deselect a button in the set, the user has to select another button in the set. Or some other trigger has to change the button back to Normal.
Depending on your situation, you could try one of the following:
Okay, I'm going to try a couple things to see if I can make it do what I want it to without the button set. If I end up not being able to thwart the issue I'm envisioning, I may have to come back with a file attachment for more expert help!
If you can't get it to work, I suggest you start a new discussion to post the file. That's more likely to be seen than yet another entry on an older post. (The Forum doesn't actually tag people. And one only gets notifications if they subscribe to a given post.) Having the particular issue in a separate post would probably be more helpful for those searching the Forum in the future.
ou cannot toggle back to normal inside a button set that is by design