Overview

If you have a Views Slideshow slideshow with a Views Slideshow JCarousel carousel pager in it and display that slideshow+pager within a Colorbox, the pager misbehaves and there are javascript errors. On Chrome, the errors are:

Uncaught TypeError: Object close has no method 'call' jquery.colorbox-min.js:192
Uncaught Error: jCarousel: No width/height set for items. This will cause an infinite loop. Aborting... jquery.jcarousel.min.js:16

A similar error is seen in Firefox (about the call method).

How to Reproduce

  1. Install Colorbox, Views Slideshow, and Views Slideshow JCarousel
  2. Optional: install Colorbox Node
  3. Create node(s) with images for slideshow
  4. Create a Views Slideshow with a JCarousel pager to show node images
  5. Create a page that will open up the slideshow in a Colorbox (use Colorbox Node if desired)
  6. Open Colorbox with slideshow in it
  7. Pager will not work as expected
  8. Use browser debugger to check javascript errors

Possible Related Issues

Issue #1258544: jCarousel should call Drupal.attachBehaviors() on AJAX-loaded content (support for Colorbox etc.) talks about adding:

    Drupal.attachBehaviors();

so that the JCarousel module code works with Colorbox. I tried adding that in a couple places within the views_slideshow_jcarousel.js file with no luck, but it (or something similar) still might be the right solution.

Comments

kristen pol’s picture

Note that the Views Slideshow JCarousel pager does work within a Lightbox2 overlay.

Also, it is interesting to note that if you debug the pager using Firebug or the Chrome debugger, then the pager works. I suppose it fires some jquery that causes it to get in sync with Colorbox.