3

I am trying to set the height of a "li" will increase automatically in respect to another "li".

I have paste the sample HTML code.

<ul onclick="menu_slide('#sub1')" class="list listred" id="list">

<li onclick="toggle_div('toggle_div0')" class="name">

<span style="color:#fff;"> 

    <a style="color:#fff; text-decoration:none" href="Javascript:void(0)">Banerjee, Sraboni </a>
<br>

 UPN 414 
 </span>
<span style="color:#fff; font-weight:normal;">Billed On  06/13/2013 @ 12:11 pm</span>
<p id="last_event0" style="color:#fff;"> Assigned By Moumita Balasssssssssssssssssssss<br>sssssssssssssssssssssssss .</p>
</li>
<li class="bill">

<div style="">
<div style="display:none" id="checkedicon_0" class="tick_mark_list"> 
    <span style="cursor:pointer" onclick="remove_checkedicon(0, '1092')"><img width="25px" src="images/tick_mark.png"></span> 
</div>   
<!-- Code for message --> 
<!-- Checking whether this provider has any biller message or not starts -->
<div style="padding:6px 8px 0 8px; box-shadow: 0 0 9px -3px #000000 inset;
-webkit-box-shadow: 0 0 9px -3px #000000 inset;
-moz-box-shadow: 0 0 9px -3px #000000 inset;
-o-box-shadow: 0 0 9px -3px #000000 inset;float:left; border-radius:3px; background: #fff;  position: relative;
    right: 3px;
    top: 3px; visibility: hidden;"><span><img src="images/spech.png"></span>
    </div>
<!-- Checking whether this provider has any biller message or not ends -->
<!--Code for message-->

<!--<a href="add_bill.php?patient_id=&type=Primary" class="but3" style="margin-right:0;"><span>A</span>DD</a>patient_bill_id-->
        <a onclick="open_slide('1092', 'Sraboni Banerjee')" style="margin-right:0;" class="but3" href="Javascript:void(0)"><span>A</span>DD</a>
    <a onclick="unfollow_patient('1092','Primary','2')" class="unfollow" href="Javascript:void(0)"><span>X</span></a>
<div class="clear"></div>
</div>
<div class="clear"></div>
    </li>

    <div class="clear"></div>
</ul>

Here you can find 2 li inside an ul. I want to increase the height of the second li with first li. Is there anyway in jquery to fix this. I have attach the screen shot for better understanding. enter image description here . Here you can see in first row height of the right most button become less than the actual height of row.

4

2 回答 2

1

你可以试试EqualHeights jQuery 插件

该插件的功能非常简单,因为它旨在只做一件事:将您指定的所有元素设置为相同的高度。

演示页面: http ://www.cssnewbie.com/example/equal-heights/plugin.html

于 2013-06-20T13:46:03.203 回答
0

做你所要求的非常简单。当您开始拥有充满问题元素的页面时,复杂性就会出现,并且如果您希望它触发可能在代码之外发生的调整大小(如果发生这种情况)。这是一个基本示例,但可以扩展...

http://jsfiddle.net/bfE4L/

有问题的主要代码是......

$("#li2").height($("#li1").height());
于 2013-06-20T13:53:29.787 回答