0

I have a carousel using the jCarousel plugin.

I would like to dynamically add 5 new images to a carousel containing 10.

That is easy enough with the carousel.add method inside a for loop.

The only issue is, it adds these 5 new items to the end of the carousel list, where I would like to add them to the beginning of the carousel list!

I can't see that jCarousel supports this — and can't seem to figure out how to add items to the beginning of a carousel list without resetting the carousel altogether (I was hoping this wasn't the answer).

Thanks (:

Community
  • 1
  • 1
Sally
  • 11
  • 2

2 Answers2

1

If you put a negative integer in the add method it should prepend it.

Example: carousel.add(-1,html);

Flexo
  • 87,323
  • 22
  • 191
  • 272
awats
  • 447
  • 2
  • 5
-2

You can edit its library jcarousel.min.js at line no. 16 column no. 5441 . just replace before to after .

SOme line of code is here.

{e<=0?this.list.prepend(b):j.before(b);