View Single Post
Old 11-02-2007, 04:21 PM   #1 (permalink)
Sam Granger
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default Slide menu - show one div open on load.

Using JQuery, I have the following code:
PHP Code:
$(document).ready(function() {
    $(
'div.menu> div').hide(); 
    $(
'div.menu> h3').click(function() {
        $(
this).next('div').slideToggle('fast')
        .
siblings('div:visible').slideUp('fast');
    });
}); 
My HTML:
HTML Code:
<div class="menu">
	<h3>Home</h3>
	<h3>News</h3>
	<h3>Profile</h3>
	<div>Profile list goes here....</div>
	<h3>Services</h3>
	<div>Service list goes here....</div>
	<h3>References</h3>
	<div>References list goes here....</div>
	<h3>Jobs</h3>
	<h3>Contact</h3>
</div>
What code do I have to add, if I want the Services menu for example to be open onload?

Demo of current situation: http://www.phpencoder.org/

Looking forward to suggestions/examples!
Sam Granger is offline  
Reply With Quote