Click to See Complete Forum and Search --> : Help with hide/show layers


goboi
03-20-2006, 08:12 PM
I have been using HTML and some JavaScript for a while now, but this mixing with PHP/CSS has me stumped. I am trying to get the menu to load in the open position on page load. (www.cginformation.org) The categories on the left, here is the current code:
<div id="sidebar">
<ul>
<li>
<h2>
<a href="#" title="<?php _e('Categories'); ?>" onload="showlayer('subcat1');"><?php _e('Categories'); ?></a>
</h2>
<ul id="subcat1" style="display:none; margin:0px; padding:0px;">
<?php wp_list_cats(); ?>
</ul>
</li>
<li>
<h2>
<a href="#" title="<?php _e('Archives'); ?>" onclick="showhidelayer('subcat2');"><?php _e('Archives'); ?></a>
</h2>
<ul id="subcat2" style="display:none; margin:0px; padding:0px;">
<?php wp_get_archives('type=monthly'); ?>
</ul>
</li>
<li><script type="text/javascript" src="http://embed.technorati.com/embed/2axrcuxhvt.js"></script><br>
<!-- Site Meter XHTML Strict 1.0 -->
<script type="text/javascript" src="http://s23.sitemeter.com/js/counter.js?site=s23cginformation">
</script>
</li>
<li><a href="http://www.mozilla.org/products/firefox/"><img src="http://ryanerickson.com/uscg/wp-content/themes/Wuhan/images/firefox.gif" border="0"></a></li>
<li><a href="http://cginformation.org"><img src="http://ryanerickson.com/uscg/images/cginfo.png"></a></li>

</ul>
</div>

As the code is now, one has to click on the categories to drop down the menu, what do I need to change in this code to have it show on load without having to click on it? Thanks in advance! ~Ryan

bpat1434
03-21-2006, 01:07 AM
Well, the JS function would have been helpful to look at; however, if you just call the function on page load, you'll be fine:
<body onLoad="showhidelayer('subcat1');">
THis will automatically show the "Categories" sub-categories....

goboi
03-21-2006, 02:08 AM
My god do I feel stupid, I was trying to get WAY to into it. Thanks bpat1434!

bpat1434
03-21-2006, 11:44 AM
No problem!!

It took me some time to... had to get the frames source.... #2 reason why I hate frames, different sources...