Resize testimonial box onAfter each slide

by andyjh07

HTML

<div id="testimonials">
    <div id="customer-review-cycle">
        <p></p>
    </div>
</div>

JavaScript

$(document).ready(function () {
    $("#customer-review-cycle").cycle({
        fx: "scrollVert",
        before: onAfter,
        slideResize: 0
    });
    function onAfter(curr, next, opts, fwd) {
        var index = opts.currSlide;
        //get the height of the current slide
        var $ht = $(this).height();
        //set the container's height to that of the current slide
        $(this).parent().animate({
            "height": $ht
        });
    }
});