<div class="panel"> <p>Because time is valuable, we deliver quick and easy learning.</p> <p>At W3School, you can study everything you need to learn, in an accessible and handy format.</p> </div>
这个是js脚本$(document).ready(function(){ /* This code is executed after the DOM has been completely loaded */ /* Changing thedefault easing effect - will affect the slideUp/slideDown methods: */ $.easing.def = "easeOutBounce"; var i=0; /* Binding a click event handler to the links: */ $('li.button a').click(function(e){
/* Finding the drop down list that corresponds to the current section: */ var dropDown = $(this).parent().next(); /* Closing all other drop down sections, except the current one */ $('.dropdown').not(dropDown).slideUp('slow'); dropDown.slideToggle('slow'); $(this).removeClass("blue").addClass("orange"); //$('li.button a').eq(i).removeClass("orange").addClass("blue"); //i = $(this).attr("rownum");$('li.button a').not(this).removeClass("orange").addClass("blue"); //alert($(this).attr("rownum")); /* Preventing the default event (which would be to navigate the browser to the link's address) */ e.preventDefault(); //i++; })
});
这个是js脚本$(document).ready(function(){ /* This code is executed after the DOM has been completely loaded */ /* Changing thedefault easing effect - will affect the slideUp/slideDown methods: */ $.easing.def = "easeOutBounce"; var i=0; /* Binding a click event handler to the links: */ $('li.button a').click(function(e){
/* Finding the drop down list that corresponds to the current section: */ var dropDown = $(this).parent().next(); /* Closing all other drop down sections, except the current one */ $('.dropdown').not(dropDown).slideUp('slow'); dropDown.slideToggle('slow'); $(this).removeClass("blue").addClass("orange"); //$('li.button a').eq(i).removeClass("orange").addClass("blue"); //i = $(this).attr("rownum");$('li.button a').not(this).removeClass("orange").addClass("blue"); //alert($(this).attr("rownum")); /* Preventing the default event (which would be to navigate the browser to the link's address) */ e.preventDefault(); //i++; })
$("需要收缩的DIV的ID什么的").slideUp();
});
$(this).slideUp();
});
$("需要收缩的DIV的ID什么的").slideUp();
});是社会主义未来的花朵
<head><script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".flip").click(function(){
$(".panel").slideToggle("slow");
});
});
</script>
<style type="text/css">
div.panel,p.flip
{
margin:0px;
padding:5px;
text-align:center;
background:#e5eecc;
border:solid 1px #c3c3c3;
}
div.panel
{
height:120px;
display:none;
}
</style>
</head>
<body>
<div class="panel">
<p>Because time is valuable, we deliver quick and easy learning.</p>
<p>At W3School, you can study everything you need to learn, in an accessible and handy format.</p>
</div>
<p class="flip">Show/Hide Panel</p>
</body>
</html>
完整代码,
否则就要ajax了。。
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="34" align="left" style="background-color: #0A84D7">
<img src="images/left-01.jpg" style="margin-left: 23px" />
</td>
</tr>
<tr>
<td height="541" align="center" valign="top" background="images/left-02_r6_c2.jpg">
<ul class="container">
<li class="menu">
<ul>
<li class="button"><a href="#1" rownum="0" id="01" class="blue">行业 <span></span></a></li>
<li class="dropdown">
<ul>
<li><a href="TotalOnline.aspx" id="2">总上线率统计图</a></li>
<li><a href="CSatisfactionRanking.aspx" id="3">满意率排行</a></li>
<li><a href="CdissatisfiedRanking.aspx" id="4">不满意率排行</a></li>
<li><a href="CSatisfactionCount.aspx" id="5">满意率统计图(年,月)</a></li>
<li><a href="CDissatisfiedCount.aspx" id="6">不满意率统计图(年,月)</a></li>
<li><a href="ISatisfactionCount.aspx" id="7">满意率统计图(总)</a></li>
<li><a href="IDissatisfiedCount.aspx" id="8">不满意率统计图(总)</a></li>
<li><a href="CDissatisfiedContentCount.aspx" id="9">不满意率各项内容统计图</a></li>
<li><a href="CServiceEvaluationCount.aspx" id="10">服务评价统计图</a></li>
</ul>
</li>
</ul>
</li>
<li class="menu">
<ul>
<li class="button"><a href="#2" class="blue" id="02" rownum="1">企业<span></span></a></li>
<li class="dropdown">
<ul>
<li><a href="CompanyOnlineCount.aspx" id="12">企业上线率统计表</a></li>
<li><a href="ISatisfactionRanking.aspx" id="13">企业内部车辆满意率排名</a></li>
<li><a href="IDissatisfiedRanking.aspx" id="14">企业内部车辆不满意率排名</a></li>
<li><a href="ICDissatisfiedContentCount.aspx" id="15">企业内部不满意各项统计图</a></li>
<li><a href="CompanyOnline.aspx" id="16">企业车辆上线次数统计表</a></li>
<li><a href="CSatisfactionCompared.aspx" id="17">企业满意率对比</a></li>
<li><a href="CDissatisfiedCompared.aspx" id="18">企业不满意率对比</a></li>
</ul>
</li>
</ul>
</li>
<li class="menu">
<ul>
<li class="button"><a href="#3" class="blue" id="03" rownum="2">单车 <span></span></a></li>
<li class="dropdown">
<ul>
<li><a href="TaxiSatisfactionRanking.aspx" id="20">单车满意率排行</a></li>
<li><a href="TaxiDissatisfiedRanking.aspx" id="21">单车不满意率排名</a></li>
<li><a href="TaxiServiceEvaluationCount.aspx" id="22">单车服务评价统计图</a></li>
<li><a href="TaxiDissatisfiedCount.aspx" id="23">单车不满意率统计图</a></li>
<li><a href="TaxiSatisfactionCount.aspx" id="24">单车满意统计图</a></li>
<li><a href="TaxiOnline.aspx" id="25">单车上线次数统计图</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</td>
</tr>
<tr>
<td height="15">
<img src="images/left-02.jpg" width="250" height="15" />
</td>
</tr>
</table>
/* This code is executed after the DOM has been completely loaded */ /* Changing thedefault easing effect - will affect the slideUp/slideDown methods: */
$.easing.def = "easeOutBounce";
var i=0;
/* Binding a click event handler to the links: */
$('li.button a').click(function(e){
/* Finding the drop down list that corresponds to the current section: */
var dropDown = $(this).parent().next();
/* Closing all other drop down sections, except the current one */
$('.dropdown').not(dropDown).slideUp('slow');
dropDown.slideToggle('slow');
$(this).removeClass("blue").addClass("orange");
//$('li.button a').eq(i).removeClass("orange").addClass("blue");
//i = $(this).attr("rownum");$('li.button a').not(this).removeClass("orange").addClass("blue"); //alert($(this).attr("rownum")); /* Preventing the default event (which would be to navigate the browser to the link's address) */
e.preventDefault();
//i++;
})
});
/* This code is executed after the DOM has been completely loaded */ /* Changing thedefault easing effect - will affect the slideUp/slideDown methods: */
$.easing.def = "easeOutBounce";
var i=0;
/* Binding a click event handler to the links: */
$('li.button a').click(function(e){
/* Finding the drop down list that corresponds to the current section: */
var dropDown = $(this).parent().next();
/* Closing all other drop down sections, except the current one */
$('.dropdown').not(dropDown).slideUp('slow');
dropDown.slideToggle('slow');
$(this).removeClass("blue").addClass("orange");
//$('li.button a').eq(i).removeClass("orange").addClass("blue");
//i = $(this).attr("rownum");$('li.button a').not(this).removeClass("orange").addClass("blue"); //alert($(this).attr("rownum")); /* Preventing the default event (which would be to navigate the browser to the link's address) */
e.preventDefault();
//i++;
})
});