2009-08-12 8 views
3
<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> 

Répondre

2

Il pourrait y avoir un problème avec l'animation de l'élément de table. Contournement pour ceci est de mettre le corps de TD dans un DIV, et animer un DIV.

Dans mon code, j'utiliser quelque chose comme ceci:

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