多层层显示js
来源:易贤网 阅读:1098 次 日期:2016-06-14 09:58:09
温馨提示:易贤网小编为您整理了“多层层显示js”,方便广大网友查阅!

多层层显示js

多层层显示js<!doctype html public -//w3c//dtd xhtml 1.0 transitional//en http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd>

<html xmlns=http://www.w3.org/1999/xhtml>

<head>

<meta http-equiv=content-type content=text/html; charset=gb2312 />

<title>多层层显示js</title>

</head>

<script language=javascript>

function showdiv(i)

{

document.getelementbyid(tag1).style.display=none;

document.getelementbyid(tag2).style.display=none;

document.getelementbyid(tag3).style.display=none;

document.getelementbyid(tag4).style.display=none;

document.getelementbyid(tag+i).style.display=;

}function showdiv2(i,allnum)

{

for(temp=1;temp<allnum+1;temp++)

{

if (temp==i){document.getelementbyid(tag+temp).style.display=;}else{document.getelementbyid(tag+temp).style.display=none;}

}

}

</script>

<body>

<a href=# onmouseover=showdiv(1);>1</a>

<a href=# onmouseover=showdiv(2);>2</a>

<a href=# onmouseover=showdiv(3);>3</a>

<a href=# onmouseover=showdiv(4);>4</a>

<div id=tag1 >测试1</div>

<div id=tag2 style=display:none;>测试2</div>

<div id=tag3 style=display:none;>测试3</div>

<div id=tag4 style=display:none;>测试4</div>

<br />

<a href=# onmouseover=showdiv2(1,4);>1</a>

<a href=# onmouseover=showdiv2(2,4);>2</a>

<a href=# onmouseover=showdiv2(3,4);>3</a>

<a href=# onmouseover=showdiv2(4,4);>4</a>

</body>

</html>

更多信息请查看脚本栏目
易贤网手机网站地址:多层层显示js
由于各方面情况的不断调整与变化,易贤网提供的所有考试信息和咨询回复仅供参考,敬请考生以权威部门公布的正式信息和咨询为准!
关于我们 | 联系我们 | 人才招聘 | 网站声明 | 网站帮助 | 非正式的简要咨询 | 简要咨询须知 | 新媒体/短视频平台 | 手机站点

版权所有:易贤网