Removing active class and adding it to a sibling
Posted
by Kyle
on Stack Overflow
See other posts from Stack Overflow
or by Kyle
Published on 2009-09-14T22:54:21Z
Indexed on
2010/04/29
2:07 UTC
Read the original article
Hit count: 353
Currently, I have a jQuery Cycle plugin that allows the image to scroll. With it's callback I am calling this function
function onAfterVideoScroll() {
$('.myRemote.active').removeClass("active").next().addClass("active");
}
This SHOULD be removing the current class from another set of links, and adding the class to the it's next sibling.
This is to keep whichever image is showing it's button predecessor will be active so the user can tell which button is currently showing on the slideshow.
If this makes sense, please let me know why it will remove the active class but it never gives the sibling the active class.
Thanks!
© Stack Overflow or respective owner