jellekralt / Responsive-Tabs

Responsive Tabs is a jQuery plugin that provides responsive tab functionality. The tabs transform to an accordion when it reaches a CSS breakpoint. You can use this plugin as a solution for displaying tabs elegantly on desktop, tablet and mobile.
http://jellekralt.github.io/Responsive-Tabs/
MIT License
531 stars 228 forks source link

Styling accordion tabs individually #144

Closed terryupton closed 6 years ago

terryupton commented 6 years ago

Please correct me if I am mistaken, but I cannot see a way to style the accordion tabs individually. I have a series of tabs that each need a different colour. This is easily achieved on the desktop version, as it can be added to the markup. However, the accordion markup is fixed and JS drive. So can't manipulate in the HTML. Is there a way to be able to add individually classes to each accordion title?

class="r-tabs-accordion-title r-tabs-state-active"

jellekralt commented 6 years ago

There is indeed no way to individually style the tabs, and there is no planned feature to enable this. You could solve this with something like nth-child in CSS, or by adding classes manually with javascript.

terryupton commented 6 years ago

Any tips on how to add classes manually with javascript?