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.
Patch attached.
Comment | File | Size | Author |
---|---|---|---|
#1 | jcarousel-zebra.patch | 1.16 KB | quicksketch |
jcarousel-zebra.patch | 618 bytes | mstrelan |
Comments
Comment #1
quicksketchThanks, this is a good suggestion. I've revised your patch because I encountered a few problems with the approach:
- Our existing JS doesn't properly parse out the item number after appending " even" or " odd" to the class name. This isn't a problem with your patch but a problem with the JS. After applying your patch it made the problem apparent when using an AJAX-enabled carousel.
- This approach used $id to determine even/odd zebra striping, but $id always starts at 0. If you had a carousel with an odd number of items, you'd end up with two items with the "odd" class next to each other between pages.
This patch fixes both problems and I've committed it to both 2.x branches.