kswedberg / jquery-carousel-lite

A jQuery carousel plugin based on jCarouselLite by Ganeshji Marwaha
MIT License
177 stars 59 forks source link

How do i create two different carousals with different configuration on a single page #10

Closed alokmandloi closed 12 years ago

alokmandloi commented 12 years ago

How do i have two different carousals with different configurations on a single page.

kswedberg commented 12 years ago

Hi,

All you need to do is pass a different options map to each one. For example:

var carousel1Options = {
  auto: true,
  visible: 2,
  speed: 300,
  pause: true,
  btnPrev: function() {
    return $(this).find('.prev');
  },
  btnNext: function() {
    return $(this).find('.next');
  }
};

var carousel2Options = {
  auto: true,
  visible: 2,
  speed: 800,
  btnGo: $('div.nav').find('a')
};

$('div.carousel-1').jCarouselLite(carousel1Options);

$('div.carousel-2').jCarouselLite(carousel2Options);

Here is a demo of something similar: http://plugins.learningjquery.com/jcarousellite/demo/

alokmandloi commented 12 years ago

Thanks. it worked for me