| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 588 人关注过本帖
标题:求助点击展开收缩
只看楼主 加入收藏
whj220
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2007-1-10
收藏
 问题点数:0 回复次数:1 
求助点击展开收缩
大家有没有像论坛那样的,可以点击展开收缩那样的例子的源代码,可以发一份给我看看呀,非常感谢.
搜索更多相关主题的帖子: 源代码 例子 感谢 
2007-01-18 09:52
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8078
专家分:6657
注 册:2005-11-7
收藏
得分:0 

<SCRIPT language="JavaScript">
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
ver4 = (NS4 || IE4) ? 1 : 0;

if (ver4)
{
with (document)
{
write("<STYLE TYPE='text/css'>");
if (NS4)
{
write(".parent {position:absolute; visibility:visible}");
write(".child {position:absolute; visibility:visible}");
write(".regular {position:absolute; visibility:visible}")
}
else
{
write(".child {display:none}")
}
write("</STYLE>");
}
}

function getIndex(el)
{
ind = null;
for (i=0; i<document.layers.length; i++)
{
whichEl = document.layers[i];
if (whichEl.id == el)
{
ind = i;
break;
}
}
return ind;
}

function arrange()
{
nextY = document.layers[firstInd].pageY +document.layers[firstInd].document.height;
for (i=firstInd+1; i<document.layers.length; i++)
{
whichEl = document.layers[i];
if (whichEl.visibility != "hide")
{
whichEl.pageY = nextY;
nextY += whichEl.document.height;
}
}
}

function initIt()
{
if (!ver4) return;
if (NS4) {
for (i=0; i<document.layers.length; i++)
{
whichEl = document.layers[i];
if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
}
arrange();
}
else {
divColl = document.all.tags("DIV");
for (i=0; i<divColl.length; i++)
{
whichEl = divColl(i);
if (whichEl.className == "child")
{
if (whichEl.style.display != "block")
{
whichEl.style.display = "none";
}
// else{

// }
}
}
}
}
function expandIt(el,num)
{
if (!ver4) return;
if (IE4) {
whichEl = eval(el + "Child");
if (whichEl.style.display == "none")
{
whichEl.style.display = "block";

}
else
{
whichEl.style.display = "none";
}
}
else
{
whichEl = eval("document." + el + "Child");
if (whichEl.visibility == "hide")
{
whichEl.visibility = "show";
}
else
{
whichEl.visibility = "hide";
}
arrange();
}
}


onload = initIt;

function expandIt_1(el)
{

whichEl = eval(el + "Child");
whichEl.style.display = "block";

}
</SCRIPT>

调用expandIt(el, num);

[此贴子已经被小天狼星于2007-1-18 10:17:19编辑过]


本来无一物,何处惹尘埃
It is empty at all here, Why pm 2.5 is so TMD high!
2007-01-18 10:14
快速回复:求助点击展开收缩
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019292 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved