Take the 2-minute tour ×

Not sure if this can be done, but I would like to toggle an image (easy) BUT at the same time increase/decrease the height of another div based on the "open/close" of the toggle. I can get it to increase on click, but not on the "close" any suggestions please

I assume something goes in here?
share|improve this question

1 Answer 1

up vote 2 down vote accepted
  var nextDiv = $j(this).next('div');
  nextDiv.slideToggle('slow',function() {
    if (nextDiv.is(':visible')) {
      // decrease height
    } else {
      // increase height
share|improve this answer
Thanks Mark, works a treat, sorry can't accept answer for another 8 mins. Will accept yours a bit later. –  user351657 Jul 19 '10 at 17:41

Your Answer


