DHTML Layer visibility controlled by images (buttons)?

liunx

Guest
<!-- m --><a class="postlink" href="http://evolarts.hypermart.net/grc128/temp.html">http://evolarts.hypermart.net/grc128/temp.html</a><!-- m --><br />
<br />
<br />
I wanna use those buttons to hide all other layers and show just a certain layer......is this possible?<br />
<br />
Example: I click the About Us button and it sets the visibility of the about layer to visible, now when i click any of the other button it hides all other layers and then opens the layer its linked to........<br />
<br />
<br />
Update: No luck thus far.....I've got the layout with the 4 layers done, I've got the code to hide all layers and the code to show a certain layer, just can't figure out how to attach it to these buttons....<!--content-->what's the code, or a url from where you got the code ?<!--content-->function showSec(n) { <br />
hideSec(); <br />
if (ng5) document.getElementById('sec' + n).style.visibility = "visible"; <br />
else if (ns4) document.layers["sec" + n].visibility = "show"; <br />
else if (ie4) document.all["sec" + n].style.visibility = "visible"; <br />
}<br />
<br />
<br />
<br />
If thats cryptic at all check out the site <!-- m --><a class="postlink" href="http://www.a1javascripts.com/tutorials/Showing_Layers.html">http://www.a1javascripts.com/tutorials/ ... ayers.html</a><!-- m --> the code I posted is java to hide all layers first then show a given layer and its cross-browser code as you can see =) <br />
<br />
<br />
This shouldn't be hard to attach to a button right? I'm still a newb to web coding in many ways =\<br />
<br />
<br />
********Opps sorry I believe you have to use all the code listed on that page so go check out the website first.....I believe the other coding is needed to allow this action*********** <br />
<br />
I tried adding a onClick to my buttons but it doesn't seem to work right.....out of desperation I emailed the author of that article with complete detail and an apology attached heh<!--content-->i was just about to say you call it with a javascript onclick/onmouseover event:<br />
<a href=http://www.htmlforums.com/archive/index.php/"#" onclick="showSec(2)">click here</a><br />
<br />
<br />
have you got the names of the layers right? # being the name of the layer<br />
why don't you copy the source code of the example into your editor, then you can see a working version.<!--content-->Found a much easier way to implement, at least for my newb a$$..........<!-- m --><a class="postlink" href="http://getelementbyid.com/tutorials/showhide/index.shtml">http://getelementbyid.com/tutorials/sho ... ndex.shtml</a><!-- m --><br />
<br />
<br />
Since this is just a class project and I only have to worry bout it working on a Mac using IE, this is good for me. For some odd reason it all looks right and aligned in dreamweaver.........yet when I open it in IE its offset....so far only the home and links button are coded. Here is the link <!-- m --><a class="postlink" href="http://evolarts.hypermart.net/grc128/temp3.htm">http://evolarts.hypermart.net/grc128/temp3.htm</a><!-- m --><br />
<br />
<br />
is it due to the browser window size? I haven't put in the code to resize the window on open yet.....<!--content-->possibly, try setting it slightly to the left and up a bit in dreamweaver and see if it turns out ok in the browser?<!--content-->yea bumped it up by like 17 or so and its prefect, now I've just gotta load all my content and find a wav file of someone scratching a record for the mouseover sounds.....then put in my flash movie as the intro and I'm done.....sweet =)<!--content-->
 
Back
Top