Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple rows functionality in new version #61

Open
superhector opened this issue Apr 18, 2013 · 4 comments
Open

multiple rows functionality in new version #61

superhector opened this issue Apr 18, 2013 · 4 comments

Comments

@superhector
Copy link

Hi,
i really like this plugin.i have been using older version for single row carousal but i need the carousal effect for multiple rows. I went through issues list and someone already reported this problem in new version and u answered it by saying that you will be wriiting extended plugin for the same. If you are already done with taht then please update the document else give me some suggestions how to make it useful for mutiple rows

@richardscarrott
Copy link
Owner

I've not got around to writing an extension to support multiple rows, partly due to the lack of time and partly because features such as variable width items and continuous support make it more difficult than it was in the old carousel.

In the meantime I'd recommend either outputting two items in each <li> or using the slave / master approach demonstrated here - #22

@superhector
Copy link
Author

Thanks a lot!!!!..As of now, i used master/slave approach but there is a problem with this approach that if you will start dragging master widget conatiner then slave conatiner will get dragged in sync but vice versa is not true. so is ther any event through which i can detect which conatiner is being dragged(master or slave).once i come to know that if master is being dragged then i can bind 'before' event wit this and invoke slave and simillarly if slave is being dragged then can bind 'before' event with slave and invoke master.

@richardscarrott
Copy link
Owner

You could do something like this:

master.carousel({
    create: function () {
        $(this).find('.rs-carousel-runner').on('drag', function () {
            slave.find('.rs-carousel-runner').css('left', $(this).css('left')); // if using `translate3d` left will need to be changed for transform.
        });
     },
     before: function () {
          slave.carousel('goToPage', master.carousel('getIndex'));
     },
     touch: true
});

Thinking about this you'd then need to make the slave / master relationship a peer relationship as they both need to control one another (e.g. in case the 'slave' was swiped to the next or prev position).

It'd be fairly easy to do using the above as a starting point but to be honest I think outputting the mark-up with two items inside one <li> would simplify the whole issue and if you can't do that serverside then you could just manipulate the DOM before instantiating the carousel clientside.

@martinbean
Copy link

Hi. I could do with multiple rows adding back in too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants