$(document).ready(function() { $('#description').show()...">

JQuery slideToggle not working with colspan in Firefox?

<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>
+3
source share
1 answer

There may be a problem with the animation of the table element. A workaround for this is to include the TD body in the DIV and the DIV animation.

In my code, I use something like this:

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

Source: https://habr.com/ru/post/1715029/


All Articles