这是我一段时间以来一直遇到的问题。
在第一张图片中,您可以在单击展开之前看到我的布局部分:
点击后看看上面的文字会发生什么:
我不完全确定为什么会发生这种情况。
这是我的代码:
<html>
<head>
<title>Program Status Page</title>
<link type="text/css" rel="stylesheet" href="style.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#Hidden").hide();
//toggle the componenet with class msg_body
jQuery("#Even").click(function()
{
jQuery(this).next("#Hidden").slideToggle(500);
});
jQuery("#Odd").click(function()
{
jQuery(this).next("#Hidden").slideToggle(500);
});
$("#Test").on("click", function(){
if ( +$(".weight", this).text() < 50 )
$(this).appendTo("#unlikelyToBeCalled");
});
});
</script>
</head>
<body class="body">
<img class="Top" src="Top-Bar.png" />
<h1> Likely to be called</h1><br />
<div id="Likely">
<div id="Even">
<div class="ProgramName">Blah11332131231231231</div>
<div class="ProgramGraph">Blah23412312313</div>
<div class="Status">Blah</div>
</div>
<div id="Hidden">
<div class="Weight"> 1234</div>
<div class="Values">Value1: Blah</div>
<div class="Overrides">Overrides</div>
</div>
</div>
<img class="Bottom" src="Bottom-Bar.png" />
</body>
CSS 非常基础。
body.body {
background-color: #d0c9c9;
min-width: 1600px;
height: 100%
overflow-x: hidden;
}
#Likely{
position:relative;
margin-left:auto;
margin-right:auto;
display: table;
font-size:24px;
width: 80%;
}
#Unlikely{
position:relative;
margin-left:auto;
margin-right:auto;
display: table;
font-size:24px;
width: 80%;
}
#Unable{
position:relative;
margin-left:auto;
margin-right:auto;
display: table;
font-size:24px;
width: 80%;
}
#Even{
display: table-row;
position:relative;
margin-left:auto;
margin-right:auto;
width: 80%;
font-size:24px;
width: 80%;
float: right;
}
#Odd{
display: table-row;
position:relative;
margin-left:auto;
margin-right:auto;
font-size:24px;
width: 80%;
float:right;
}
#Hidden{
position:relative;
display: table-row;
height:40px;
margin-left:auto;
margin-right:auto;
background-color: #336699;
width: 80%;
}
.ProgramName{
display: table-cell;
width: 10%;
position:relative;
top:0;
left:0;
}
.ProgramGraph{
display: table-cell;
width: 60%;
position:relative;
top:0;
left:0;
}
.Status{
display: table-cell;
width: 10%;
position:relative;
top:0;
left:0;
}
.Weight{
display: table-cell;
width: 10%;
position:relative;
top:0;
left:0;
}
.Values{
display: table-cell;
width: 60%;
position:relative;
top:0;
left:0;
}
.Overrides{
display: table-cell;
width: 10%;
position:relative;
top:0;
left:0;
}
.Top{
position:relative; top: 0;
opacity: 0.95;
filter:alpha(opacity=95);
background-color:#131313;
width: 100%;
}
.Bottom{
position:absolute; bottom: 0;
opacity: 0.95;
filter:alpha(opacity=95);
background-color:#131313;
width: 100%;
}
我希望有人可以使上层 div (id="Even") 完全不受从它上掉下来的子面板的影响。万分感谢!