• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 411
  • Last Modified:

jquery active class added on click

Here is a link to a slider that has been developed with the help of EE
http://gromit.utopia.co.nz/~safeware/newsslider/index.html

As you will see, when the scroller cycles through an active class is added to the current pager number.

I  also need to add the active class to a pager number when a specific number is clicked.
Essentially, I need to highlight the current pager number regardless of if it has rolled around or or is clicked upon.
Can anyone assist?
Cheers,
N
0
Neil_Bradley
Asked:
Neil_Bradley
  • 2
1 Solution
 
leakim971PluritechnicianCommented:
$("#btns a").click(function() { 
      $("#btns a").removeClass("active");
      $(this).addClass("active"); 
});

Open in new window


and use CSS :
#btns a:hover {
    color:blue;
}

Open in new window

0
 
leakim971PluritechnicianCommented:
better :
$("#btns a").click(function() { 
      $("#gallery li").removeClass("selected");
      $("#btns a").removeClass("active");
      $(this).addClass("active"); 
});

Open in new window

with css :
#btns a:hover {
    color:blue;
}

Open in new window

0
 
Neil_BradleyWeb UX/UI DeveloperAuthor Commented:
Beautiful.. That got it.
Thanks again.
Neil
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now