62,046
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<style type="text/css">
td{font-size:12px}
td.select{background-color:#eee}
td.noselect{background-color:#fff}
.hide{display:none}
.block{display:block}
</style>
<script language="javascript">
function resizeList(o)
{
var definedH = "60px"
var listDiv = document.getElementById("list");
if(listDiv.style.height=="100%")
{
listDiv.style.height=definedH;
listDiv.style.overflowY="scroll";
o.value="+";
}else
{
listDiv.style.height="100%";
listDiv.style.overflowY="hidden";
o.value="-";
}
}
var curID="t0";//当前title
function show(o)
{
var titleID = o.id;
var cTbl = document.getElementById("content");
var curObj = document.getElementById(curID);
curObj.className="noselect";
o.className="select";
curID=o.id;
if(titleID=="t0")//显示所有内容
{
for(var i=0;i<cTbl.rows.length;i++)
{
cTbl.rows[i].className="block";
}
}else //其他根据title显示
{
for(var i=0;i<cTbl.rows.length;i++)
{
cTbl.rows[i].className=(cTbl.rows[i].id.indexOf(titleID)==-1?"hide":"block");
}
}
}
</script>
</head>
<body>
<table width="400px" border="1" cellpadding="0" cellspacing="2">
<tr class="trFixed">
<td colspan="2">
<table style="width:100%">
<tr>
<td>Refrence</td>
<td align="right"><input type="button" value="+" onclick="resizeList(this)"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" width="100px">
<table style="width:100%;cursor:hand" cellspacing="0" id="title">
<tr>
<td class="select" id="t0" onclick="show(this)">标签属性/属性</td>
</tr>
<tr>
<td id="t1" onclick="show(this)">行为</td>
</tr>
<tr>
<td id="t2" onclick="show(this)">集合</td>
</tr>
</table>
</td>
<td>
<div style="height:60px; overflow-y:scroll;margin:0" id="list" >
<table style="width:100%;height:100%" id="content" border=1>
<tr id="t11">
<td>aaaa</td>
</tr>
<tr id="t12">
<td>aaaa</td>
</tr>
<tr id="t20">
<td>bbbbb</td>
</tr>
<tr id="t21">
<td>ccccc</td>
</tr>
<tr id="t22">
<td>ccccc</td>
</tr>
<tr id="t23">
<td>ccccc</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</body>
</html>