I would like to write an If Statement in jQuery that will accomplish the following:
if li.slideNum:first has a class of ‘active’, addClass ‘disabled’ to li.prev, else removeClass ‘active’ from li.prev.
I have a series of slides with a navigation that goes: Previous | 1 | 2 | 3 | 4 | 5 | Next. I am wanting to add a class of ‘disabled’ to ‘Previous’ when slide 1 has a class of ‘active’ and a class of ‘disabled’ to ‘Next’ when slide 5 has a class of ‘active’. Then of course make sure Previous does not have a class of ‘disabled’ when slides 2-5 have a class of ‘active’ and Next does not have a class of ‘disabled’ when slides 1-4 have a class of ‘active’. I have everything else for my slides and nav working, this is the last thing before it is all working perfectly.
Any thoughts on how I can accomplish this best?
Sounds like you are looking for this: