Button actions: Show/hide layers???
Hi,
I checked the forums to find a way to show or hide layers within a page using a button.
All I've seen is actually popup layers, would that be the only solution?
What I try to achieve is a section of the page, a rectangle, displaying 5 different images with associated text depending on which 5 buttons (looking like tabs) have been clicked.
Each rectangle content is in a specific layer, and only one layer would be shown at a time.
How do I associate actions to those buttons?
A click on one button would need to:
1- hide the current layer and show the one I want
2- change its own button look so it is marked as "pressed"
Or should I use a navbar instead, acting like a tab?
Could the navtab activate/hide layers without moving to another page?
Thanks for any help.
Re: Button actions: Show/hide layers???
Re: Button actions: Show/hide layers???
Thanks, but where do I add this info? In which object?
I was able to add a navbar as a tab and have each one show one of the layers, but it would be nice to actually be able to correctly manage this.
If the user click outside of the layers, they disappear.
When arriving on the page, the default layer is not shown, even though it's not hidden.
2 Attachment(s)
Re: Button actions: Show/hide layers???
The code below will open layers 1 & 2 and close layers 3 & 4
Re: Button actions: Show/hide layers???
Thanks Drwyd,
This works perfectly and I learned something.
To improve it, any idea on the following?
1- Activate the first layer when arriving on the page. Even though the layer is not marked as hidden, it doesn't appear unless I click its tab
2- Any way to have the navbar tabs actually show the focus (hightlight the currently selected one)?
Thanks for any help.
1 Attachment(s)
Re: Button actions: Show/hide layers???
Hi Sjordi
To highlight the current tab you could put the effect on the popup layer itself.
For auto popup on load see sample file below.
1 Attachment(s)
Re: Button actions: Show/hide layers???
]Here is an example of what I think you are trying to achieve.
[ATTACH]87112[/ATTACH
Re: Button actions: Show/hide layers???
That's exactly what I need.
So it looks like I won't use a navbar for tab navigation but "fake" tabs instead. Clickable and revelaing/hiding... :-)
Re: Button actions: Show/hide layers???
Hello!
That is what I looking for but with fade effect to show and hide layer. Do you think is it possible ?
Thanks
Raff
1 Attachment(s)
Re: Button actions: Show/hide layers???
I think the attached will do what you need:Attachment 104146.
No need for popup links, this simply uses layers and fade transitions.
I did it for four tabs and a base layer so you could discover how to do the fifth.
Acorn