views:

39

answers:

2

Hi

I'm using the cycle plugin on some divs, like this:

<div class="sections">
  <div class="Section"> <img /> text </div>
  <div class="Section"> <img /> text </div>
  <div class="Section"> <img /> text </div>
</div>

all the .section divs have variable height, based on their contents. How can I make cycle not to resize the container div (sections) to the largest child height? Instead I want the container to resize on every animation to the current child height.

A: 

set containerResize option to 0 and try. More option details here.

Teja Kantamneni
A: 

ok, I managed to do it by hooking a function on 'after' event:

function onAfter(curr, next, opts, fwd) {
  var $ht = $(this).height();

  //set the container's height to that of the current slide
  $(this).parent().animate({height: $ht});
}

found the info here: http://forum.jquery.com/topic/jquery-cycle-auto-height

Alex