I have some problems that are trying to add / remove a class from links and their siblings. I have Each link in groups is loading a page in an iframe, so they are all static links. I also have a collapse toggle function in the top of each group of links in jQuery. Actually, I'm thinking that someone can help me to understand why the selection of jQuery will remove the 'selected' class from the previous link, which is in a different group than the newly selected link . Any help / suggestions are appreciated, thank you in advance. Even though I have a code so far. - jquery - - HTML - & lt; Div class = "collapse_content" & gt; There are 3 groups of links contained in ... & lt; / Div & gt; I was able to get jQuery to add and remove the 'selected' class from the link in the same container, but if I select a link in another container then the previous selected link will be its class Will not be able to overcome
$ (function () {// ('click', function (e) {$ (this) .addClass ('selected') O Brother (sister). RemoveClass ('(' selected '';;)); // Toggle class collapse_tab $ (".colapse_tab") with omponenet.click (function () {$ (this) .next (" Collapse_content "). Slide Toggle (500);});}); A
Comments
Post a Comment