当前位置:编程学习 > asp >>

javascript的图片浏览

答案:<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href=><script language="javascript">
var w=200;
function closenavi() {
w-=10;
if (w>-10) {window.parent.testframeset.cols = ''+w+',*';repeat=setTimeout("closenavi()",10);}
else {clearTimeout(repeat);w=200;}
}



function initIt(){
        divCount = document.all.tags("DIV");
        for (i=0; i<divCount.length; i++) {
            obj = divCount(i);
            if (obj.className == "child" || obj.className == "child1") obj.style.display = "none";
        }
}

function expandIt(el) {

        obj = eval("page" + el);
        obj2 = eval("main" + el);
        if (obj.style.display == "none") {
            obj.style.display = "block";
            obj2.all.tags('img')[0].src='images/icon-folder1-open.gif';
            obj2.all.tags('img')[1].src='images/icon-folder-open.gif';
        }
        else {
            obj.style.display = "none";
            obj2.all.tags('img')[0].src='images/icon-folder1-close.gif';
            obj2.all.tags('img')[1].src='images/icon-folder-close.gif';
        }

}

onload = initIt;

var judge=0;
function expandall(o) {
if (judge==0) {divCount2 = document.all.tags("DIV");
        for (i=0; i<divCount2.length; i++) {
            obj2 = divCount2(i);
            if (obj2.className == "child" || obj.className == "child1" || obj2.style.display == "none")
            {obj2.style.display = "block";}
            if (obj2.className == "menu")
            {obj2.all.tags('img')[0].src='images/icon-folder1-open.gif';
            obj2.all.tags('img')[1].src='images/icon-folder-open.gif';
            }
}

judge=1;
o.src='images/icon-closeall.gif';
o.alt='全部折叠';
}
else {divCount2 = document.all.tags("DIV");
        for (i=0; i<divCount2.length; i++) {
            obj2 = divCount2(i);
            if (obj2.className == "child" || obj.className == "child1" || obj2.style.display == "block")
            {obj2.style.display = "none";}
            if (obj2.className == "menu")
            {obj2.all.tags('img')[0].src='images/icon-folder1-close.gif';
            obj2.all.tags('img')[1].src='images/icon-folder-close.gif';
            }
}

judge=0;
o.src='images/icon-expandall.gif';
o.alt='全部展开';
}
}

</script>
</head>

<body bgcolor="#FFFFFF" text="#000000" onselectstart="return false;">
<table id=control width="100%" border="0" cellspacing="0" cellpadding="0" class="borderon">
<tr>
<td height="20" style="padding-top:3px"><nobr> 站点导航</nobr></td>
<td width="20" align="center" valign="top"><img src=http://old.zzzyk.com/article/Article/"images/icon-expandall.gif" width="16" height="15" class="button" onclick="expandall(this)" vspace="2" alt="全部展开"></td>
<td width="20" align="center" valign="top"><img src=http://old.zzzyk.com/article/Article/"images/icon-close.gif" width="16" height="15" class="button" onClick="closenavi()" vspace="2" alt="关闭左栏"></td>
</tr>
</table>

<div id="navi" style="position:relative; width:100%; height:expression(body.offsetHeight-control.offsetHeight-2); z-index:1; left: 0px; top: 0px; overflow: auto">
<table width="180" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" width="12"><img src=http://old.zzzyk.com/article/Article/"images/spacer.gif" width="12" height="12"></td>
<td valign="top"> </td>
</tr>
<tr>
<td valign="top"> </td>
<td valign="top">


<div id="main1" class="menu" onClick="expandIt('1'); return false"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="35"><img src=http://old.zzzyk.com/article/Article/"images/icon-folder1-close.gif" width="15" height="13"><img src=http://old.zzzyk.com/article/Article/"images/icon-folder-close.gif" width="16" height="15" align="absmiddle"></td>
<td>原创作品</td>
</tr>
</table>
</div>
<div id="page1" class="child" style="padding-left:15px">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20"><img src=http://old.zzzyk.com/article/Article/"images/icon-page.gif" width="16" height="15" align="absmiddle" hspace="4"><a href=></tr>
<tr>
<td height="20"><img src=http://old.zzzyk.com/article/Article/"images/icon-page.gif" width="16" height="15" align="absmiddle" hspace="4"><a href="page02

上一个:用纯CSS作按钮Good
下一个:在ie客户端模拟键盘输入!

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,