Could you post how you got the code to dynamically decide the height of the expanded div? I have a grid system that will possibly have text that moves outside of the alloted 100px height. It could be 105px or it could be 600px tall.
On Jul 24, 11:38 pm, Su <[EMAIL PROTECTED]> wrote: > Doh! I forgot to come back on this. What you suggest is pretty much > exactly what I ended up doing once I sat on it for a bit and decided I > was overthinking. I'll have to steal the selector for the animation > value, though. More elegant than the variable I used *grin* Thanks. > > On Thu, Jul 24, 2008 at 12:11 PM, Karl Swedberg <[EMAIL PROTECTED]> wrote: > > Hi Su, > > One way you could do it is to make sure that the contents of the div are > > contained within another div. Something like this: > > <div id="outer"> > > <div> > > <h3>Heading</h3> > > <p>paragraph</p> > > <p>another paragraph</p> > > <!-- more stuff here --> > > </div> > > </div> > > Then you could animate the outer div to the inner div's height: > > $(document).ready(function() { > > var initHeight = $('#outer').height(); > > $('#outer').hover(function() { > > $(this).animate({height: $('> div', this).height()}, 400); > > }, function() { > > $(this).animate({height: initHeight}, 400); > > }); > > > }); > > You don't have to animate it, of course, but I thought that would look cool. > > :-) > > > --Karl > > ____________ > > Karl Swedberg > >www.englishrules.com > >www.learningjquery.com > > > On Jul 24, 2008, at 12:22 PM, Su wrote: > > > Let's say I have a div with a CSS height of 200px, with > > overflow:hidden, and so there's content clipped inside it. > > Is there any way to have .hover() make that div expand down to reveal > > the internal content, without having to manually specify the target > > height? > > > Since overflow:auto produces proportional scrollbars, I have the > > impression that the browser /does/ know this number somehow, but I > > have no idea how to get at it.