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.
Hi,
the height of .views-cycle-container ist not adjusted automatically.
I figured out, that this part dont work: (views_cycle.js)
// Find the tallest item and set the height to that item's height + padding,
// unless we already have an explicit maximum height set.
if (config.params.height) {
config.params.height = config.params.height + verticalPadding;
}
else {
cycler.children('li').each(function () {
var li = $(this);
if (li.height() > tallest) {
tallest = li.height();
}
});
config.params.height = tallest + verticalPadding;
}
"li.height()" allways returns 0! When I display the heigth of the li in a "document.ready()" function, it works and returns the correct height... I dont know why, because "Drupal.behaviors" should work like "document.ready()"...
Maybe someone has a idea how to fix this!
I tried to bugfix within the module code, but i was not successful ... so i wrote a fast and dirty bugfix!
My "dirty" bugfix .. just add it to your theme javascript
//Bugfix - Stellt cycle auf richtige höhe ein
$('.views-cycle-container').each( function(){
var cycle = $(this);
var tallest = 0;
cycle.children('.views-row').each( function(){
if($(this).height() > tallest){
tallest = $(this).height();
}
})
cycle.height(tallest);
});