<!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>
<meta charset="utf-8"/>
<title></title>
<style type="text/css">
body
{
margin: 0 auto;
padding: 0px;
}
#pn
{
background: #e8e8e8;
width: 600px;
height: auto;
margin: 0 auto;
padding: 5px;
font-size: 9pt;
}
.slide
{
margin: 0;
padding: 0;
width: 600px;
border-top: solid 4px gray;
margin: 0 auto;
}
.btn-slide
{
background: gray;
text-decoration: none;
text-align: center;
width: 120px;
height: 30px;
padding: 10px 0 0 0;
display: block;
color: #FFF;
margin: 0 auto;
}
</style>
<script type="text/javascript">
function showdiv() {
document.getElementById("hpn").style.display = "block";
document.getElementById("strHref").href = "javascript:hidediv();";
document.getElementById("strHref").innerHTML = "收起-";
}
function hidediv() {
document.getElementById("hpn").style.display = "none";
document.getElementById("strHref").href = "javascript:showdiv();";
document.getElementById("strHref").innerHTML = "展开+";
}
</script><!--上面是我的代码,不能执行,不知为什么 -->
<!-- <script type="text/javascript">
function showdiv() {
document.getElementById("hpn").style.display = "block";
document.getElementById("strHref").href = "javascript:hidediv();";
document.getElementById("strHref").innerHTML = "收起-";
}
function hidediv() {
document.getElementById("hpn").style.display = "none";
document.getElementById("strHref").href = "javascript:showdiv();";
document.getElementById("strHref").innerHTML = "更多选项+";
}
</script> 这是可以执行的资料下载中的源代码剪切-->
</head>
<body>
<div id="pn">
<p>
手机 - 商品筛选</p>
<p>
网络:移动4G 联通3G 电信3G</p>
<div id="hpn" style="display: none">
<p>
价格:5000元以上 4000-4999 3000元以下</p>
<p>
特点:0元购机 防水 长待机</p>
</div>
</div>
<p class="slide">
<a href="javascript:showdiv();" id="strHref" class="btn-slide">展开</a> <!--点击按钮-->
</p>
</body>
</html>