Is there any way to add the classes 'odd' and 'even' to 'div.owl-item' in the settings? If not, how can add it in the template file?

I think this could be a feature request.

CommentFileSizeAuthor
#1 2496941-1.patch658 bytesrpayanm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rpayanm’s picture

Category: Support request » Feature request
Status: Active » Needs review
FileSize
658 bytes

Here a patch for test.

However you can try this (working without this patch):

CSS:

.owl-wrapper .owl-item:nth-child(odd) {
  color: green;
}

.owl-wrapper .owl-item:nth-child(even) {
  color: red;
}

SCSS:

.owl-wrapper {
  .owl-item:nth-child(odd) {
    color: green;
  }
  .owl-item:nth-child(even) {
    color: red;
  }
}

  • swim committed 6ee978e on 7.x-2.x authored by rpayanm
    Issue #2496941 by rpayanm: How to add the classes
    
swim’s picture

Status: Needs review » Fixed

Normally I'd say do this by CSS but your one-liner is pretty. Sorry about the commit message, singles quotes from the title xD.

Thanks for the patch,

  • swim committed ecefc5a on 7.x-1.x authored by rpayanm
    Issue #2496941 by rpayanm: 7.x-1.x backport, How to add the odd even...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.