Link to home
Start Free TrialLog in
Avatar of Neil_Bradley
Neil_BradleyFlag for New Zealand

asked on

use jquery to add an acrive class

I am trying to add an active class to the 1,2,3 buttons on this slider
http://gromit.utopia.co.nz/~safeware/newsslider/index.html

IE, if slider 1 is showing then class="active" is added to the Number 1 button etc..
Can anyone assist?
Cheers,
N
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Neil_Bradley

ASKER

You made that look too easy!
Brilliant solution and appreciate the quick response.
Cheers,
Neil
Just a quick follow up.
Playing with the code a little and I noticed that when div id="buttons" is wrap in another div the script stops working..
http://gromit.utopia.co.nz/~safeware/newsslider/index.html
Any way to specifically target the #id=buttons?
Cheers,
Neil
set an ID for the div where you've the LI, for example : divID <div id="divID">
So instead : $("#buttons").next("div")
use : $("#divID")
Cheers, that got it.
I am going to open up another question regarding this slider (specifically the active function) as I am keen to go a step further.
Look forward to your participation..
Neil