This fiddle works as intended, when the last li has a class on, the first li gets a class of first.
I am trying to use the same principle with the jQuery Cycle plugin. If you have a look at this fiddle you will see that the cycle plugin adds a class of activeSlide to the active slide. I have put some code in fidle which I thought would handle it but it looks as though maybe I have my logic wrong?
You’re only checking for the activeSlide class once, when the document is loaded. Wrap your logic inside a click handler on the rows and it should work:
Click here for live example
What if I want to check for the active slide on each interval of the cycle?
You can add a callback to the
afteroption and run the logic there as well. Check out all the available options for more information.Click here for a live example