2012-12-14 219 views
0

靈活的高度,我有兩個DIV箱左右...我需要在正確的格框,左框的內容靈活房源的高度是不固定的......也就是說,如果我在「左格添加一些內容框」 ..然後 '權利DIV盒子' 自動流內容框的高度應相應地調整

這裏是一個link極品溢出DIV內容

/CSS/

.dvleft{float:left;} .dvright{float:right}.dv100per{width:100%;float:left} 
.grey_bg2{padding: 5px 0px 8px 7px;background-color:#F7F7F7;color:#000; font-size:13px} 
.mTop5{margin-top:5px;}.mTop10{margin-top:10px}.mTop20{margin-top:20px}.mleft15{margin-left:15px;} 
    .contactlist{background-color:#FFF;float:left;width:100%;padding: 5px 0px 10px 0px;height:239px;overflow:auto} 
    .sharecon{float:left;width:100%; border-bottom:solid 1px #e6e6e6; padding:3px 0 6px 0} 

/HTML/

<div class="dvright grey_bg2 mTop20" style="width: 365px; padding: 7px 8px 10px 8px;"> 
    <div class="dv100per"> 
     <span class="dvleft"> 
      <strong>Right Box</strong> 
     </span> 
    </div> 

     <div class="contactlist"> 
      <div class="sharecon"> 
       <span class="dvleft"> 
        <input type="checkbox" name="checkbox"> 
       </span> 

       <span class="dvleft mleft15"> 
        <strong class="text11">abc123..</strong> 
       </span> 
       <span class="dvleft mleft15">[email protected]</span> 

      </div><!--sharecon--> 
      <div class="sharecon"> 
       <span class="dvleft"> 
        <input type="checkbox" name="checkbox"> 
       </span> 

       <span class="dvleft mleft15"> 
        <strong class="text11">abc123..</strong> 
       </span> 
       <span class="dvleft mleft15">[email protected]</span> 

      </div><!--sharecon--> 
      <div class="sharecon"> 
       <span class="dvleft"> 
        <input type="checkbox" name="checkbox"> 
       </span> 

       <span class="dvleft mleft15"> 
        <strong class="text11">abc123..</strong> 
       </span> 
       <span class="dvleft mleft15">[email protected]</span> 

      </div><!--sharecon--> 
      <div class="sharecon"> 
       <span class="dvleft"> 
        <input type="checkbox" name="checkbox"> 
       </span> 

       <span class="dvleft mleft15"> 
        <strong class="text11">abc123..</strong> 
       </span> 
       <span class="dvleft mleft15">[email protected]</span> 

      </div><!--sharecon--> 
      <div class="sharecon"> 
       <span class="dvleft"> 
        <input type="checkbox" name="checkbox"> 
       </span> 

       <span class="dvleft mleft15"> 
        <strong class="text11">abc123..</strong> 
       </span> 
       <span class="dvleft mleft15">[email protected]</span> 

      </div><!--sharecon--> 
      <div class="sharecon"> 
       <span class="dvleft"> 
        <input type="checkbox" name="checkbox"> 
       </span> 

       <span class="dvleft mleft15"> 
        <strong class="text11">abc123..</strong> 
       </span> 
       <span class="dvleft mleft15">[email protected]</span> 

      </div><!--sharecon--> 
      <div class="sharecon"> 
       <span class="dvleft"> 
        <input type="checkbox" name="checkbox"> 
       </span> 

       <span class="dvleft mleft15"> 
        <strong class="text11">abc123..</strong> 
       </span> 
       <span class="dvleft mleft15">[email protected]</span> 

      </div><!--sharecon--> 
      <div class="sharecon"> 
       <span class="dvleft"> 
        <input type="checkbox" name="checkbox"> 
       </span> 

       <span class="dvleft mleft15"> 
        <strong class="text11">abc123..</strong> 
       </span> 
       <span class="dvleft mleft15">[email protected]</span> 

      </div><!--sharecon--> 
      <div class="sharecon"> 
       <span class="dvleft"> 
        <input type="checkbox" name="checkbox"> 
       </span> 

       <span class="dvleft mleft15"> 
        <strong class="text11">abc123..</strong> 
       </span> 
       <span class="dvleft mleft15">[email protected]</span> 

      </div><!--sharecon--> 
      <div class="sharecon"> 
       <span class="dvleft"> 
        <input type="checkbox" name="checkbox"> 
       </span> 

       <span class="dvleft mleft15"> 
        <strong class="text11">abc123..</strong> 
       </span> 
       <span class="dvleft mleft15">[email protected]</span> 

      </div><!--sharecon--> 
      <div class="sharecon"> 
       <span class="dvleft"> 
        <input type="checkbox" name="checkbox"> 
       </span> 

       <span class="dvleft mleft15"> 
        <strong class="text11">abc123..</strong> 
       </span> 
       <span class="dvleft mleft15">[email protected]</span> 

      </div><!--sharecon--> 
     </div><!--contactlist--> 

</div><!--Right Block Ends Here---> 

</div> 
+0

請詳細說明你的問題。 –

+0

我需要爲我插入左格框更多的內容來調整合適的div的高度...請檢查的jsfiddle ... – Gaurav

回答

0

如果您正在使用j個查詢,然後試試這個,

$(function(){ 
    var leftDivHeight = $('.dvleft').height(); 
    var rightDivHeight = $('.dvright').css({height: leftDivHeight}); 
}); 
+0

感謝納雷什...您的幫助它的工作對我來說now..Thanks ... :) – Gaurav

+0

好吧,這是我的榮幸,我能幫助你。 –

0

你可以使用jQuery插件equalizeCols

+0

給定的鏈接我該如何使用它..?請提供任何例子鏈接... – Gaurav

+0

不會在我的情況下工作..因爲我想調整溢出內容的高度... :( – Gaurav

+0

啊,所以數學是答案 – bondythegreat