Fòrums de discussió Fòrums de discussió

Vés enrere

How to toggle buttons in a group

Commuta
How to toggle buttons in a group
Resposta
23/01/19 11:45
I have 5 buttons which when clicked will each show a layer. How do I change the color of the last button clicked to remain dark, and then switch it back to the normal color when another button is clicked?
0 (0 Vots)

RE: How to toggle buttons in a group
Resposta
23/01/19 20:50 com a resposta a Kirsten Burnett.
Hi Kirsten,
There are 2 ways to do this - the simple way, or the elegant way.  With 5 buttons, either choice is valid.  If you had 10 or 30 buttons, I would recommend the elegant method - it uses some more advanced concepts (tag lists and for loops), but allows for one action to handle any number of objects.  Here's a video for both methods, and you can decide which makes the most sense for your needs:

Simple way - http://share.smartbuilder.com/public/support/button_group_simple.mp4

Elegant way (using tag lists and for loops) - http://share.smartbuilder.com/public/support/button_group_tag_list.mp4

Hope that helps!
0 (0 Vots)