Dom

luck 2015-07-02

<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<head>

<metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/>

<title>无标题文档</title>

</head>

<scripttype="text/javascript"src="docs.js"></script>

<scripttype="text/javascript">

/*varb=true;

functionchang(){

vardivNo=byTag("div")[0];

/*

if(b)

{

divNo.style.height="8px";

divNo.style.overflow="hidden";

b=false;

}

else

{

divNo.style.height="8px";

divNo.style.overflow="visible";

b=true;

}

if(divNo.className=="close")

{

divNo.classname="open"

}else{

divNo.classname="close";

}

}

*/

functionlist(){

//vardtNo=byTag("dt")[0];

//vardlNo=byTag("dl")[0];

vardtNo=event.srcElement;

vardlNo=dtNo.parentNode;

if(dlNo.className=="open")

{

dlNo.classname="close";

}else{

dlNo.classname="open";

}

}

</script>

<styletype="text/css">

.open{

overflow:visible;

}

.close{

overflow:hidden;

}

dl{

overflow:hidden;

height:16px;

}

</style>

<body>

<dl>

<dtonclick="list()">列表</dt>

<dd>张三1</dd>

<dd>张三2</dd>

<dd>张三3</dd>

<dd>张三4</dd>

<dd>张三5</dd>

</dl>

<dl>

<dtonclick="list()">列表</dt>

<dd>张三1</dd>

<dd>张三2</dd>

<dd>张三3</dd>

<dd>张三4</dd>

<dd>张三5</dd>

</dl>

</body>

</html>

相关推荐