I have a question regarding the jCarousel plug-in (from sorgalla). How do I remove items from it the right way?
You can see how far I\'ve gone here. Try deleting a
$.jcarousel.fn.extend({
removeAndAnimate: function(index) {
var itemsHTML = new Array();
var counter = 0;
// Me guardo los que quedan
for(i = 0; i < this.size(); i++)
{
if(i != (index - 1))
itemsHTML[counter++] = $('li[jcarouselindex|="' + i + '"]').html();
}
// Configuro uno menos y borro todo
this.size(this.options.size -1);
this.reset();
// Vuelvo a cargarlos
counter = 0;
for(i = 0; i < itemsHTML.length; i++)
{
this.add(counter++, itemsHTML[i]);
}
this.reload();
}
});
USAGE
var carousel = jQuery('#mycarousel').data('jcarousel');
carousel.removeAndAnimate(1);