$(document).ready(function(){
  $('#accordion > li ul')
  .click(function(event){
  event.stopPropagation();
  
  })
  .filter(' :not(:first)')
  .hide();
  
  $('#accordion > li,#accordion > li > ul > li').click(function(){
  var selfClick=$(this).find('url:first').is('visible');
  if(!selfClick){
  $(this)
  .parent()
  .find('> li ul:visible')
  .slideToggle();
  }
  $(this)
  .find('ul:first')
  .stop(true,true)
  .slideToggle();
  });
});
#accordion {
	width:200px;
}
#accordion li{
	cursor: pointer;
	background:url(accordion_bg.png) repeat-x;
	font-weight:bold;
	color:#015287;
	border:1px solid #b2b2b2;
	margin-bottom:2px;
	list-style-image:none;
	list-style-position:outside;
	list-style-type:none;
	-moz-border-radius: 4px;
	-webkit-border-radius: 4px;
	padding: 4px 8px;
}

#accordion li.active{
	color:#D15600
}
#accordion li ul{
	padding:0;
	margin:10px 0 0 0;
}

#accordion .second {
	background:url(accordion_bg.png) repeat-x;
	border:1px solid #b2b2b2;
	font-weight: bold;
}

#accordion li.active li{
	text-indent:0;
}
#accordion li li{
	font-weight: normal;
	background:none;
	border:0;
}
<!doctype html>
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>StarTrackr!</title>
	
	<link rel="stylesheet" href="../../css/base.css" type="text/css" media="screen" charset="utf-8"/>
	<link rel="stylesheet" href="accordion.css" type="text/css" media="screen" charset="utf-8"/>

	<script src="../../lib/jquery-1.7.1.min.js" type="text/javascript" ></script>
	<script type="text/javascript" src="script.js"></script>
</head>
<body>
	<div id="container">
		<div id="header">
			<h1>StarTrackr!</h1>
		</div>
		<div id="content">
			<h2>
				Welcome!
			</h2>
      <div id="navigation">
				<ul>
					<li><a href="#">Home</a></li>
					<li><a href="#">Buy Now!</a></li>
					<li><a href="#">About Us</a></li>
					<li><a href="#">Gift Ideas</a></li>
				</ul>
			</div>

			<p id="intro">
				Welcome to <strong>StarTrackr!</strong> the planet's premier celebrity tracking and monitoring service. Need to know where in the world the best bands, musicians or producers are within 2.2 square meters? You've come to the right place. We have a very special special on B-grade celebs this week, so hurry in!		
			</p>
			<p id="disclaimer">
				Disclaimer! This service is not intended for the those with criminal intent. Celebrities are kind of like people so their privacy should be respected.
			</p>
      
      <div id="celebs">
  			<h2 class="heading">Our Celebrities</h2>
  			<p class="info">
  				We have an ever changing roster of newly chipped celebrities. But it can take as little as a week for the little critters to realise they've been tagged - so you have to be fast! 
  			</p>
        <ul id="accordion">
        	<li class="active">
        		A-List Celebrities
        		<ul>
        			<li><a href="#">Computadors</a> &nbsp;New!</li>
        			<li class="second">
        				Rising Stars
        				<ul>
        					<li><a href="#">Johny Stardust</a></li>
        					<li><a href="#">Beau Dandy</a></li>
        				</ul>
        			</li>
        			<li class="second">
        				Falling Stars
        				<ul>
        					<li><a href="#">Kellie Kelly</a></li>
        					<li><a href="#">Darth Fader</a></li>
        				</ul>
        			</li>
        		</ul>
        	</li>
        	<li>
        		B-List Celebrities
        		<ul>
        			<li><a href="#">Sinusoidal Tendancies</a></li>
        			<li><a href="#">Steve Extreme</a></li>
        		</ul>
        	</li>
        	<li>
        		Has Beens
        		<ul>
        			<li><a href="#">Duran Duran Duran</a></li>
        			<li><a href="#">Mike's Mechanic</a></li>
        		</ul>
        	</li>
        	<li>
        		Barely Famous Celebrities
        		<ul>
        			<li><a href="#">Lardy Dah</a></li>
        			<li><a href="#">Rove Live</a></li>
        		</ul>
        	</li>
        </ul> 
      </div>
      
      <div id="comment">
        <h2>Leave a comment</h2>
        name:<br />
        <input type="text" /><br/>
        comment:<br/>
        <textarea rows="5" cols="30"></textarea>
      </div>
			
			<h2>Fine Print</h2>
			<p id="fine_print">
				Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.		
			</p>
		</div>

		<div id="footer">
			<p>
				&copy; Copyright 2010 CelebriTracker Productions
			</p>
		</div>
	</div>
</body>
</html>

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.