本帖最后由 黄基焜 于 2013-6-9 10:19 编辑
- <!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=utf-8" />
- <title>无标题文档</title>
- <script type="text/javascript" src="doctool.js"></script>
- <script type="text/javascript">
- function change()
- {
- var dtNode = event.srcElement;
- var dlnode = dtNode.parentNode;
- //alert(divNode.nodeName);
- if(dlnode.className == "open")
- dlnode.className = "close"
- else
- dlnode.className = "open"
-
- }
- </script>
- <style type="text/css">
- .open{
- overflow:visible;
- }
- .close{
- overflow:hidden;
- }
- dl{
- overflow:hidden;
- height:16px;
- }
- </style>
- </head>
- <body>
- <dl onclick="change()">
- <dt>上层标题上层标题</dt>
- <dd>下层标题下层标题下层标题</dd>
- <dd>下层标题下层标题下层标题</dd>
- <dd>下层标题下层标题下层标题</dd>
- <dd>下层标题下层标题下层标题</dd>
- </dl>
- <dl onclick="change()">
- <dt>上层标题上层标题</dt>
- <dd>下层标题下层标题下层标题</dd>
- <dd>下层标题下层标题下层标题</dd>
- <dd>下层标题下层标题下层标题</dd>
- <dd>下层标题下层标题下层标题</dd>
- </dl>
- </body>
- </html>
复制代码 效果图如下:文字为什么会叠在一起啊?毕老师的会自动延伸的
|
|