Описуйте проблему сразу и полностью
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script>
$(document).ready(function() {
$(".content, .content1").css('display','none');
//toggle the componenet with class msg_body
$(".heading").click(function(){
var content = $('.content1');
$('.content').slideToggle(500);
$('.menu2 li a').removeAttr('id');
$('.menu2 li a.heading').attr('id','active');
if(content.css('display')=='block'){
content.slideUp(500);
}
return false;
});
$(".heading1").click(function(){
var content = $('.content');
$('.content1').slideToggle(500);
$('.menu2 li a').removeAttr('id');
$('.menu2 li a.heading1').attr('id','active');
if(content.css('display')=='block'){
content.slideUp(500);
}
return false;
});
});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
#active{
background:#eee;
color:#333;
text-decoration:none;
border:1px solid #c0c0c0;
border-radius:5px;
padding:5px 10px 5px 10px;
}
</style>
</head>
<body>
<p>Меню 1</p>
<ul class="menu">
<li><a href="#" class="heading">Button</a></li>
<li><a href="#" class="heading1">Button2</a></li>
</ul>
<p>Меню 2</p>
<ul class="menu2">
<li><p><a href="#" class="heading">Button</a></p></li>
<li><p><a href="#" class="heading1">Button2</a></p></li>
</ul>
<div class="content">Lorem ipsum dolor sit amet</div>
<div class="content1">Lorem ipsum dolor sit amet2</div>
</body>
</html>