Carousel using a function passed a target element I've made a carousel, which uses a function that is passed a target element, and from this element it adds next, prev, next next, and prev prev classes to its siblings (causing the rotation) - what do they call this, pyramid code?

Looking at this code - it works, but can't stand know that there is probably a better way to write this:

   var render = function (cont) {
      cont.parent().find('.active').removeClass();
      cont.attr('class', 'active');
      cont.parent().children().removeClass('next prev next_next prev_prev');
      cont.next().attr('class', 'next');
      cont.prev().attr('class', 'prev');
      cont.next().next().attr('class', 'next_next');
      cont.prev().prev().attr('class', 'prev_prev');      
   };
You can remove the active class along with the other classes, and you can chain the prev and next calls:

var render = function (cont) {
  cont.parent().children().removeClass('active next prev next_next prev_prev');
  cont.addClass('active');
  cont.next().addClass('next').next().addClass('next_next');
  cont.prev().addClass('prev').prev().addClass('prev_prev');      
};