javascript 可收缩的DIV
.btn{width:60px;height:25px;padding-top:3px;border:1px solid #999999;background:#f0f0f0; cursor:hand;}.showmid{ visibility:visible; overflow: hidden; height: 80px;}.showall{ display:block;}function di
<style>
.btn{width:60px;height:25px;padding-top:3px;border:1px solid #999999;background:#f0f0f0; cursor:hand;}
.showmid{
visibility:visible;
overflow: hidden;
height: 80px;
}
.showall{
display:block;
}
</style>
<script>
function displayDiv(obj)
{
if(obj.className=="showmid")
{
obj.className="showall";
document.getElementById("btnDisplay").value="隐藏";
}
else
{
obj.className="showmid";
document.getElementById("btnDisplay").value="显示全部";
}
}
</script>
<input type="button" name="btnDisplay" value="显示全部" οnclick="displayDiv(document.getElementById('divOrders'))" class="btn" />
<div id="divOrders" class="showmid">
asdfasdfasfas
内容
</DIV>
更多推荐
所有评论(0)