Jquery 手风琴,里面有表格
我正在尝试完成以下任务:
<div id="accordion">
<% i = 0 %>
@handle_paises.each do |pais|
@handle_publi_pais = Paquete.paque_pais(pais.id_pais)
if !@handle_publi_pais.blank? %>
<h3><a href="#"><%= pais.nombre %></a></h3>
<div class="section">
<table border="0" cellspacing="0" cellpadding="0" id="paque_tr_5">
<%@handle_publi_pais.each do |pais_cargado|%>
<tr>
<td width="71%" align="left" valign="top" id="paque_tr_1">
<%= pais_cargado.nombre_promocion.to_s %>
</td>
<td width="10%" align="center" valign="bottom" id="paque_tr_3">
<a href="xxx" title="yyy">
<img src="yyy" width="26" height="18" border="0"/>
</a>
</td>
</tr>
<% i += 1 end%>
</table>
</div>
<% end%>
</div>
但是,每个部分都以巨大的高度呈现(这是添加的,我不知道如何添加(并且不,此类在任何 css 文件上没有任何条目)
为什么是这发生了吗?
Thanxxx
更新:
这是JSFIDDLE的输出
<div class="section ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active" style="height: 663.6px;" role="tabpanel">
I'm trying to accomplish the following:
<div id="accordion">
<% i = 0 %>
@handle_paises.each do |pais|
@handle_publi_pais = Paquete.paque_pais(pais.id_pais)
if !@handle_publi_pais.blank? %>
<h3><a href="#"><%= pais.nombre %></a></h3>
<div class="section">
<table border="0" cellspacing="0" cellpadding="0" id="paque_tr_5">
<%@handle_publi_pais.each do |pais_cargado|%>
<tr>
<td width="71%" align="left" valign="top" id="paque_tr_1">
<%= pais_cargado.nombre_promocion.to_s %>
</td>
<td width="10%" align="center" valign="bottom" id="paque_tr_3">
<a href="xxx" title="yyy">
<img src="yyy" width="26" height="18" border="0"/>
</a>
</td>
</tr>
<% i += 1 end%>
</table>
</div>
<% end%>
</div>
however, each section is rendered with a HUGE height (which is added I don't know how to the (and no, this class doesn't have any entry on any css file)
Why is this happening?
Thanxxx
UPDATE:
this is the output of the
<div class="section ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active" style="height: 663.6px;" role="tabpanel">
Here's the JSFIDDLE: http://jsfiddle.net/GaqLZ/2/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
heightStyle: "fill" 是您正在寻找的属性。
heightStyle: "fill" is the property you're looking for.
我相信您正在寻找的是 autoHeight 选项:
autoHeight
默认为 true 并使所有 div 的大小相同。因此,它会寻找最高的那个,并对每一个都使用该高度。autoHeight: false
使每个单独的 div 的高度仅与其内容一样高。如果您希望各个节点在打开后可关闭,您可以添加
collapsible: true
属性。I believe what you're looking for is the autoHeight option:
autoHeight
defaults to true and makes all of the div's the same size. So it looks for the one that is the tallest, and uses that height for every single one.autoHeight: false
makes each individual div only as tall as it's content.You can add the
collapsible: true
property if you want the individual nodes to be close-able after opening them.