Removing an item from jCarousel plug-in

前端 未结 5 977
臣服心动
臣服心动 2020-12-17 06:27

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

5条回答
  •  甜味超标
    2020-12-17 07:02

    My other solution was to add a class to my loaded content and delete all the items that don't have this class in the DOM. Once "removed" by carousel.reset(), these elements lose systematically the added class.

    You will be able then to remove the white boxes with:

    $("li:not(.the_class)").remove();
    

    Add it just after the carousel.add() function.

    It works well and you don't even have to add any function to your carousel.

    This is an "easy to go" solution and a click on the prev/next buttons may show a white box. To remove it, apply the same solution on the callback buttonNextCallback / buttonPrevCallback.

提交回复
热议问题