Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Here is what I am currently seeing as the code to enable responsiveness of the carousel.
/**
* Callback for reponsive views.
*/
Drupal.jcarousel.responsiveCallback = function($carousel) {
if ($carousel.options.responsive) {
var width = $carousel.innerWidth();
$carousel.jcarousel('items').width(width);
}
}
Code in the example given from the Jcarousel website is this:
.on('jcarousel:reload jcarousel:create', function () {
var carousel = $(this),
width = carousel.innerWidth();
if (width >= 600) {
width = width / 3;
} else if (width >= 350) {
width = width / 2;
}
carousel.jcarousel('items').css('width', Math.ceil(width) + 'px');
})
I'm not familiar enough with javascript to figure out how to make this work, but it doesn't seem to be working at all as is. I assume that it's the javascript here that is the problem.
Comments
Comment #2
deggertsen CreditAttribution: deggertsen as a volunteer commentedSeeing this error in the chrome dev console.
Uncaught TypeError: Cannot read property 'responsive' of undefined
It's referencing line 160 of jcarousel.js