【问题标题】:jQuery slideToggle doesn't work with colspan in Firefox?jQuery slideToggle 不适用于 Firefox 中的 colspan?
【发布时间】:2010-11-19 03:30:30
【问题描述】:
<script type="text/javascript">
$(document).ready(function() {


    $('#description').show();
    $('#extender').click(function() {
    $('#description').slideToggle("fast");

    });

});  
</script>

 <tr>
    <td>cell1</td>
    <td><a href="#" id="extender">link</a></td>
  </tr>
  <tr id="description">
    <td colspan="2" class="desc">This should span two columns but it doesnt bla jaajja</td>
  </tr>
  <tr>
    <td>cell1</td>
    <td>cell2</td>
  </tr>

【问题讨论】:

    标签: jquery slidetoggle html-table


    【解决方案1】:

    动画表格元素可能存在问题。 解决方法是将 TD 的身体放入 DIV 中,并为 DIV 设置动画。

    在我的代码中,我使用了这样的东西:

           var el = $("TR.post_"+_id+' TD');
           el.wrapInner("<div/>");
           $("TR.post_"+_id+' TD DIV').slideUp('500');
           setTimeout(function(){el.remove()},500);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-21
      • 1970-01-01
      • 2011-05-24
      • 2019-11-15
      • 1970-01-01
      相关资源
      最近更新 更多