On May 1, 10:02 am, "[email protected]" <[email protected]> wrote: > Hi, > > Today I was trying to apply a slideToggle on a tbody element: > > > The problem is that jQuery changes the css display attribute of the > tbody to 'block'. > > When I use toggle(); instead of slideToggle(); it does work, and the > css display attribute is being set to 'table-row-group' (like you > expect). > > Is this a bug? Or is this meant to be this way for some reason? > > Thanks in advance
The ready-made animation methods are meant to be used for block-level elements only. You can't make a table row shorter than it's content in most cases for example, making a slide animation quirky/useless. Try creating your own instead: // toggle(fn,fn) is the click equivalent of hover() // http://docs.jquery.com/Events $('thead').toggle(function(){ $('tbody').animate({ height: 0 }); }, function(){ $('tbody').animate({ height: '30px' }); }); --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---
