2014-05-25 35 views
2

嗯,我有以下内容:http://jsfiddle.net/a9VDa/12/如何填写剩余的div?

我想让jquery树填充div“a”的其余内容,但如果没有足够的空间也包括滚动。

<div class="a"> 
    <div class="b"></div> 
    <div class="c" id="tree"></div> 
</div> 
+0

你是什么意思“让树填充div a的剩余内容”?也许是这样的:http://jsfiddle.net/Bt2sL/1/ –

+0

我不希望橙色部分滚动。 – user240713

回答

0

我的建议解决方案:http://jsfiddle.net/Bt2sL/2/

  • 没有橙色部分滚动。

HTML

<div class="b"></div> 
<div class="a"> 
    <div class="c" id="tree"></div> 
</div> 

CSS

.a { 
    height: 60px; 
    background-color: red; 
    height: auto; 
    overflow: scroll; 
    height: 200px; // adjust this to your need 
} 

.b { 
    height: 22px; 
    background-color: coral; 
} 
.c { 
    background-color: lightblue; 
} 
+0

200px在一个是有效的唯一原因...我需要“一个”是100% – user240713

0

你能不能做出格b固定,并添加一些填充到具有溢出滚动集?

.a { 
    height: 60px; 
    background-color: gray; 
    position: relative; 
    overflow: scroll; 
    padding-top: 22px; 
} 

.b { 
    position: fixed; 
    top: 0; 
    height: 22px; 
    background-color: coral; 
} 
.c { 
    background-color: lightblue; 
    height: auto; 
    overflow: scroll; 
}