首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

为什么小弟我的overflow做打开时其他内容无法向上递进,而形成重叠

2013-01-05 
为什么我的overflow做打开时其他内容无法向下递进,而形成重叠?!DOCTYPE html PUBLIC -//W3C//DTD XHTML

为什么我的overflow做打开时其他内容无法向下递进,而形成重叠?
为什么小弟我的overflow做打开时其他内容无法向上递进,而形成重叠

<!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>无标题文档</title>

<script type="text/javascript">

function closewords() {
var dlnodes = document.getElementsByTagName("dl");
for(var i=0; i<dlnodes.length; i++) {
dlnodes[i].className = "close";
}
}

function showwords(dtnode) {
var dlnode = dtnode.parentNode;
if(dlnode.className == "open"){
dlnode.className = "close";}
else{
closewords();
dlnode.className = "open";}
}


</script>
<style type="text/css">
.open{
overflow:visible;}
dl,.close{
height:16px;
overflow:hidden;}
</style>

</head>

<body>

<dl>
<dt onclick="showwords(this)">目录目录目录目录</dt>
<dd>第一目录</dd>
<dd>第一目录</dd>
<dd>第一目录</dd>
<dd>第一目录</dd>
</dl>
<dl>
<dt onclick="showwords(this)">目录目录目录目录</dt>
<dd>第二目录</dd>
<dd>第二目录</dd>
<dd>第二目录</dd>
<dd>第二目录</dd>
</dl>
<dl>
<dt onclick="showwords(this)">目录目录目录目录</dt>
<dd>第三目录</dd>
<dd>第三目录</dd>
<dd>第三目录</dd>
<dd>第三目录</dd>
</dl>
<dl>
<dt onclick="showwords(this)">目录目录目录目录</dt>
<dd>第四目录</dd>
<dd>第四目录</dd>
<dd>第四目录</dd>
<dd>第四目录</dd>
</dl>

</body>
</html>



[解决办法]

.open{
overflow:visible;height:auto;}

热点排行
Bad Request.