js拉動效果
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>拉動效果</title>
<style type="text/css">
.item{height:25px;line-height:25px;}
</style>
<script language="JavaScript">
<!--
function ColOrExpand(index)
{
if(typeof index=="number")
{
var o=document.getElementById("div"+index);
if(o)
{
if(o.style.display=="none")
{
//這部分的內容自己組織
o.innerHTML="<table width='500px' height='300px'><tr><td colspan='2'>標題</td></tr><tr><td>1</td><td>內容主題目1</td></tr><tr><td>2</td><td>內容主題目2</td></tr></table>";
for(var i=1;i<4;i++)
{
var div=document.getElementById("div"+i);
if(div)div.style.display="none";
}
o.style.display="";
}
}
}
}
//-->
</script>
</head>
<body>
<div>
<div class="item"><a href="javascript:ColOrExpand(1)">創新能力</a></div>
<div id="div1" style="display:none"></div>
<div class="item"><a href="javascript:ColOrExpand(2)">團隊管理</a></div>
<div id="div2" style="display:none"></div>
<div class="item"><a href="javascript:ColOrExpand(3)">業務知識</a></div>
<div id="div3" style="display:none"></div>
</div>
</body>
</html>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.