On our site, whatever wrap setting is used, the overall width of the carousel is much larger than it ought to be.

Each of the carousel items (li.jcarousel-item) has a width of 520px. However, the container block (ul#nc_videos_test) is 6240px wide for authenticated users, and 3120px wide for anonymous users.

When you advance through the carousel, the value on ul#nc_videos_test for left will be 520px less than the previous value, until it is 520px less than the total width.

At that time, the carousel will cycle back to the beginning, if the wrap: "last" or wrap: "both" setting is used. Otherwise, it will stop advancing.

If the wrap: "first" setting is used, when you click "Prev" on the first item, it will change left on ul#nc_videos_test to width-520px.

See my post in http://drupal.org/node/244860 for how wrap: "circular" behaves.

Below for the details on our setup, if you wish to try to reproduce this.

Module versions used:NodeCarousel 5.x-1.0, jCarousel 5.x-1.2, Node Queue 5.x-2.0.

NodeQueue Size: 10
# of Items: 3
Items are all Page nodes

Nodecarousel Data Collection: Static
# to Fetch: 3

Nodecarousel JS Settings:

  var jcar = jQuery('ul#nc_videos_test').jcarousel({
    visible: 1,
    scroll: 1,
    vertical: false,
    wrap: "last",
    auto: 0,
    animation: 'fast',
    start: 1,
    buttonNextHTML: '<div>Next</div>',
    buttonPrevHTML: '<div>Prev</div>',
    itemFirstInCallback: trigger_js_scroll_1,
    itemLastInCallback: fetchMoreCarousel_1,
    initCallback: initialize_1,
    itemVisibleInCallback: item_visible_1,
    itemVisibleOutCallback: item_invisible_1
  });

Custom CSS:

#popular_block .node-carousel-item{
width: 460px;
}
#popular_block .jcarousel-item {
height: auto;
}

#popular_block .jcarousel-clip-horizontal {
width:auto;}

.um-home #popular_block .content .jcarousel-container-horizontal {
border:none;
height:auto;
overflow:auto;
width:520px;
}

The theming function (template.php) we're using to pull up the nodes is as described in http://drupal.org/node/228291.

Comments

Mike Sances’s picture

subscribing

I think this may be a problem whenever a complete node is used. When I theme the module to include only the node title, body text, or teaser text, all works fine. I'd like to figure out how to get this to work with the complete node, however.


function phptemplate_nodecarousel_node($node, $name='') {
  $content = '<div class="node-carousel-item">';
  $content .= '<div class="node-carousel-title node-carousel-label">'. l($node->title, 'node/'. $node->nid) .'</div>';
  $content .= '<div class="hidden nid">'. $node->nid .'</div>';
  $node_words = explode(' ', $node->title);
  $content .= '<div class="hidden node-carousel-index">'. $node_words[0] .'</div>';
  $content .= '<div>'. $node->teaser .' '.l('read more ...', 'node/'. $node->nid).' </div>';
  $content .= '</div>';
  return $content;
}
andrenoronha’s picture

how can I output the body of my nodes from this function??
I'm really crazy about it!