|
Hey All,
I was hoping someone could help me. I'm currently learning the whole dhtml and javascript thing and am having some problems.
I have learnt fine how to make one layer visible and invisible when you click on a link, but i can't quite figure this out.
I have a web page i'm building and what i have is a list of services on it. I wan't it so that when you click on a service a layer becomes visible and when you click on another service the current one(if any) disappears and then the new one becomes visible.
I have created 6 layers called service1 throught to 6 and have done all the formatting with css.
I can get one layer to appear and another to disappear but the code is very clumsy, i have used a functon called ShowContent and a functin called HideContent: javascript:ShowContent('service2') andjavascript:HideContent('service1') etc on each item in the list of services
I had a thought that you could use a nested if statement, or a switch case statement but that code is also clumsy and long.
I know there must be a simple way to do this but i just cannot get my head round it.
My thoughts are that if you have something that gets what link is clicked, ie link1 is clicked which should show the layer service 1, sets all the layers to invisible and then makes the selected layer visible and so on.
Can anyone help me, it would be most appreciated!!!!
Tom
|
|
|
|
|
|
|
|