rcarousel icon indicating copy to clipboard operation
rcarousel copied to clipboard

carousel not works with one more instance at same page

Open davirs opened this issue 11 years ago • 2 comments

this carousel not works with more then one instance of carousel.

for example, if you have 3 carousels at your page, only the first carousel works. The other two execute the commands of the first instance only.. prev and next button for example...

davirs avatar May 06 '13 14:05 davirs

that is beacuase in the CSS and javascripts they use id's as "#carousel".

try changing all such instances into classes ".carousel". It should work then.

rajanRawat avatar Sep 05 '13 09:09 rajanRawat

Like said rajanwat, yes it works. Here i have 3 instances os them and works fine with class.

var $wrapper = $('.js-rcarousel');

        $wrapper.each(function () {

            var options = {
                width: 140,
                margin: 38,
                visible: 4,
                step: 1,
                orientation: "horizontal"
            }

            var type = $(this).attr('data-type');

            if (type == 'galeries') options.height = 135;
            else if (type == 'movies') options.height = 163;

            else if( type == 'eventos' ){
                options = {
                    width: 470,
                    margin: 0,
                    height: 137,
                    visible: 4,
                    step: 1,
                    orientation: 'vertical'
                }
            }

            $(this).rcarousel(options);

        });

romuloinnocencio avatar Nov 20 '15 16:11 romuloinnocencio