Hey there. I know this is a mouthful but it all seems related to me.

Have a bit of hiccup I can't figure out and don't know if it's my set up that is wrong. I understand part of this is based on another module's example but I didn't know since the module was based on jCarousel if it was an issue to also post here. I have also posted a similar request over there.

My Views set up causes the arrows to become disabled. Here's the set up in Views 2 under Basic Settings.
Use AJAX: Yes
Items to Display: 7
jCarousel Style settings : Number of Visible Items and Scroll both set to auto.

My skin/css are set up properly to display 7 items at a time. However, the arrows are disabled (visible, just set to disabled by jCarousel).

If I set up Items to Display to Unlimited and leave the rest the same, the arrows are enabled however the carousel only scrolls through 3 items at a time rather than all visible items (7) as detailed.

Is the correct implementation of the jCarousel module to just go ahead and set Items to Display to Unlimited and specify exactly how many items to scroll to prevent fall back to the default 3 and this behavior is as intended?

Thank you and let me know if you would like more clarification on any of this.

Comments

quicksketch’s picture

jCarousel will set the arrows to disabled if there are no items to be rotated through. You mentioned that your carousel had 7 items in it, out of a total of 7 items that can be listed, right? So jCarousel doesn't enable the arrows (even if the carousel is circular).

If I set up Items to Display to Unlimited and leave the rest the same, the arrows are enabled however the carousel only scrolls through 3 items at a time rather than all visible items (7) as detailed.

I frequently set the number of items to scroll manually, but I'm not sure how it's getting "3" as the number of items to scroll. At that point, the jCarousel library is just doing what it would do normally separate from Drupal.

babycourageous’s picture

thanks @quicksketch.

I was just about to respond with an update to this. I think I was treating the module as I would a regular view with paging. Setting items to display in the Basic Settings and Use AJAX to yes. Normally this would create a view with paging arrows but in this case it didn't. After playing around with the Node Gallery jCarousel module I was basing this assumption on I learned that it also has a theme function that rebuilds the view with view->preview(). This somehow triggers jCarousel to perform as though ALL items are there even though in the view it has Items to Display set to 7. Can't say I know why that works, but it does.

Sorry for that long explanation, but I will go back to using it as I always have and as it seems to be intended. Set Items to Display to Unlimited and let the width of the jCarousel determine the items showing; also setting the number of items to scroll manually in the view settings rather than auto.

Currently the help in the view settings for Scroll says "The number of items to scroll at a time. The "auto" setting scrolls all the visible items." I don't know if this is something I should contribute as a patch though. I've never made one, but this might be a simple way to get introduced to it!

thanks again for taking the time to respond.

quicksketch’s picture

Set Items to Display to Unlimited and let the width of the jCarousel determine the items showing

Just a note about this (and the AJAX functionality of jCarousel). The number of items you limit your View to is *not* obeyed by jCarousel if you have AJAX enabled on the carousel. You can think of the number of items limit as a "pre-load" amount, then if AJAX is enabled it will list all items that match selection criteria, regardless of the limit.

The thinking behind this is that it could be quite common that you would want a carousel with "infinite scroll" by loading items via AJAX, but perhaps you wanted to pre-load the first 3 pages. The initial view limit determine the number of items that are preloaded.

I admit this isn't the best way to configure such option, and if we can figure out the technical solution to get #1276360: Preload the next page in AJAX Carousels working, we'll switch to that approach and quit abusing the View's limit settings.

babycourageous’s picture

ah.

then unfortunately I am back to the original dilemma. With Number of Items set to 7 and Use AJAX set to Yes in Basic Setting, my jCarousel is indeed not recognizing there are more items to load. The next arrow is disabled. I didn't realize I had to also set AJAX load pages checkbox in the jCarousel settings. Setting that as well as the Basic Settings Use AJAX enables the arrows properly!

I was using the Node Gallery jCarousel view as my working example and it didn't have that checkbox checked. I can't figure out why it seems to work in that case but I will return to doing it the tried and true way.

(If seeing that view export can shed any light on it for you let me know and i will fwd it along.)

thanks for your help