我想用div+css是实现这样一个效果,点击标题栏的减号时,变为最小化,其实就是隐藏内容,只剩下标题栏,点下方框后又显示隐藏的内容。
小弟的代码如下,不知道错在哪里请求高手们帮助
<style>
body {
margin:0px;
padding:0px;
font-size:12px;
text-align:center;
background-image: url(pic/bg01.jpg);
}
body > div {text-align:center; margin-right:auto; margin-left:auto;}
#content-top{margin-left:auto; margin-right:auto; width:1000px; height:1px;}
#cmid{margin-left:auto; margin-right:auto; width:800px; height:25px;}
.content{width:1000px;}
.content .left{
float:left;
width:20%;
/*border:1px solid #FF0000;*/
margin:3px;
}
.content .center{float:left;border:1px solid #ffffff;margin:3px;width:57%}
.content .right{float:right;width:20%;border:1px solid #ffffff;margin:3px}
.content .right2{float:right;width:20%;border:1px solid #ffffff;margin:3px}
.mo{height:auto;border:1px solid #CCC;margin:3px;background:#FFF}
.mo h1{background:#ECF9FF;height:18px;padding:3px;cursor:move}
.closediv{cursor:default;}
.minusspan{cursor:default;}
.mo .nr{height:80px;border:1px solid #F3F3F3;margin:2px}
h1{margin:0px;padding:0px;text-align:left;font-size:12px}
.dragging {
FILTER: progid:DXImageTransform.Microsoft.Alpha(opacity=60); opacity: 0.6; moz-opacity: 0.6
}
</style>
<script language=JScript>
<!--
//可以打包为js文件;
//关闭;
function cls(obj)
{
var win = obj.parentNode.parentNode;
var sha = win.nextSibling;
//win.style.visibility = "hidden ";
sha.style.visibility = "hidden ";
sha.style.display = "none ";
}
function op(obj)
{
var win = obj.parentNode.parentNode;
var sha = win.nextSibling;
//win.style.visibility = "hidden ";
sha.style.visibility = "visible ";
sha.style.display = "block ";
}
//创建一个对象;
//-->
</script>
<div class=content>
<div class=left id=dom0>
<div class=mo id=m0>
<h1 > m0 <span style= 'width:12;border-width:0px;color:red;font-family:webdings; ' onclick= 'op(this) '> c </span> <span style= 'width:12;border-width:0px;color:red;font-family:webdings; ' onclick= 'cls(this) '> 0 </span> </h1>
<div class= "nr " id=submenu1 style=DISPLAY> sadas </div>