问题
<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>
回答1:
There might be a problem might with animating table element. Workaround for this is to put TD's body into a DIV, and animate a DIV.
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);
来源:https://stackoverflow.com/questions/1269220/jquery-slidetoggle-doesnt-work-with-colspan-in-firefox