Project:jCarousel
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Attached patch adds support for circular carousels. Rather than scrolling back from the end to the beginning over all items in between, this will make it look as if all items are in a circle. Based off the example at http://sorgalla.com/projects/jcarousel/examples/special_circular.html .

Basic workings:
- If "wrap" option is set to "circular", all items in the carousel are stored in a list.
- The items are removed from the HTML (without this, an auto carousel would not wrap but just stop at the end)
- The itemVisibleInCallback and itemVisibleOutCallback are implemented as in the example: items are added/removed as they slide in or out of the visible area.

Patch is against current CVS 6.x-dev branch.

Tested with an auto-scrolling horizontal carousel (in combination with a slightly modified Views Carousel module). Not tested with the usage of previous/next buttons, but given the jCarousel example I assume this should work.

AttachmentSize
jcarousel.js.circular.patch1.36 KB

Comments

#1

How did you modify the Views Carousel module? Do I need to patch that as well to use this? Thanks for doing it.

#2

Status:needs review» fixed

Wow, nicely done. Also put a demonstration of it on the help page. Committed. Regarding Views Carousel, the option at #332358: Allow Circular Wrap was added.

#3

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#4

I have concerns over this patch.

Note that the patch overwrites any arguments that have been passed to itemVisibleOutCallback as well as InCallback. This is exceptionally confusing for a user because jcarousel has a themeable function which allows a user to pass arguments along to the jcarousel function.

I myself have spent about 2 hours trying to figure out why the function I was passing to these array objects was not working. Finally, I realized it was simply being overwritten.

This patch makes it impossible to theme these callbacks, which seems like a serious problem. I recommend writing the patch in such a way that it appends your function rather than overwriting everything in the field.

#5

Status:closed (fixed)» needs work

Neglected to reopen the issue in my post.

#6

Priority:normal» critical

Yup!

#7

Version:6.x-1.x-dev» 6.x-2.x-dev
Status:needs work» fixed

The 2.x branch of jCarousel module now uses the newer version of the jCarousel library, which makes this code unnecessary. As the 1.x version probably won't be receiving any further updates, I'm marking this issue as fixed. For any users wanting a working circular wrap, I suggest updating to the 2.x version. Note that parameters on the jcarousel_add() and theme('jcarousel') functions have changed, see the README.txt or built-in help pages for information on using the new parameters.

#8

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.