I have a div which contains an unordered list... After some user actions i load the div with a longer list i.e. containing more list items than the previous one. I use jquery's higher level ajax functions to do this.
我有一个div包含一个无序列表...在一些用户操作后,我加载一个较长的列表div,即包含比前一个更多的列表项。我使用jquery的更高级别的ajax函数来做到这一点。
The problem is when i load it through ajax the list elements overflow the div's bottom portion and some of them get's displayed out of the div.
问题是,当我通过ajax加载它时,列表元素溢出div的底部部分,其中一些从div中显示出来。
I haven't set any heights for the containing div assuming that it will expand to accomodate any future longer lists. I'll post the code below and will be extremely grateful if someone figures this out....
我没有为包含div设置任何高度,假设它将扩展以适应任何未来更长的列表。我将在下面发布代码,如果有人想出这个代码,我将非常感激....
#sidebar1 {
float: left;
width: 15%; /* since this element is floated, a width must be given */
background: #FFE8BF; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px 0; /* top and bottom padding create visual space within this div */
text-align:center;
}
<div id="sidebar1">
<div class="sidebarmenu">
<ul id="sidebarmenu1">
<li>
<a href="#" id="loadHotel" >
HOTEL
</a>
</li>
<li>
<a href="#" id="loadCountry">
COUNTRY
</a>
</li>
<li>
<a href="#" id="loadCity">
CITY
</a>
</li>
</ul>
</div>
</div> <!-- end #sidebar1 -->
I load the list elements into the <ul id = "sidebarmenu1">
Hope i'm clear... Thanks a lot in advance....
我将列表元素加载到
2 个解决方案
#1
0
have you tried:
你有没有尝试过:
$('ul#sidebarmenu1').removeClass('class here').AddClass('class here');
that should work
应该工作
#2
0
Figured out a workaround for the curvy corner problem...!!!
想出了弯角问题的解决方法...... !!!
after i load the menu items with ajax, i use jquery to increase the height of the div and then call curvy corners to round the edges...!
在我用ajax加载菜单项后,我使用jquery来增加div的高度,然后调用弯曲的角来绕边缘......!
Voila..!!!!
瞧.. !!!!
#1
0
have you tried:
你有没有尝试过:
$('ul#sidebarmenu1').removeClass('class here').AddClass('class here');
that should work
应该工作
#2
0
Figured out a workaround for the curvy corner problem...!!!
想出了弯角问题的解决方法...... !!!
after i load the menu items with ajax, i use jquery to increase the height of the div and then call curvy corners to round the edges...!
在我用ajax加载菜单项后,我使用jquery来增加div的高度,然后调用弯曲的角来绕边缘......!
Voila..!!!!
瞧.. !!!!