Welcome fellow developers,
I am in need of a little guidance as I am struggling to find a starting point. Please excuse my lack of working code for this issue.
I have searched far and wide on the web, but I can't determine if the solution to my problem is simple or if it requires some specialized knowledge.
Current Scenario: I have chosen Cycle2 as my slider plugin (and I strongly prefer sticking with it - switching to another slider would be challenging for me). Each slide will be assigned a specific "colour" class along with a 'slide' class.
What I'm Looking For:
I want to switch classes on the <body>
element based on the active slide's colour class.
Ideas:
I haven't decided on a naming convention for the colour classes yet, but I am considering something like .col-[name]
where [name] could be yellow, red, etc. So, when the active slide has the class col-yellow, this class should be added to the <body>
, allowing me to apply different background styles (CSS) to the body element.
If the active slide changes its colour class to something like col-red, then the <body>
class should match accordingly.
I hope this explanation is clear and that someone out there in the Stack Overflow community can assist me with this challenge.
Thank you for taking the time to read through my query!