Hey all, I'm using Better Coda Slider from this link:
http://jqueryfordesigners.com/coda-slider-effect/

The part of the code that I need fixed for my site is here:

function selectNav() {
        $(this)
            .parents('ul:first')
                .find('a')
                    .removeClass('selected')
                .end()
            .end()
            .addClass('selected');
    }

In my design I have two sets of navigation UL both with classes named
"tabnavigation". I had to split up the navigation into two sets of
UL's because of the requirements of my design.

How it's supposed to work, is that when a link is clicked, it searches
all of the anchor links in the parent UL and removes the 'selected'
class, and then adds 'selected' to the anchor link that was clicked.

However, because I have two sets of ULs it only works for each UL
individually. For example, UL1 has anchor links a1 and a2. UL2 has a
links a3 and a4. Clicking between a1 and a2 works - it switches the
'selected' class between the two of them. Clicking between a3 and a4
also works. However, if I click a1 and then a3 (or a4) then both a1
and a3 (or a4) have the selected class applied.

Likewise when I click on a3 and then on a1 (or a2) then both a3 and a1
(or a2) have selected applied.

What I want is that code above changed so that it looks in both of my
ULs (both with a class named tabnavigation applied to them) and
removes the 'selected' class from all anchor links in both, and leave
the part where it adds the 'selected' to the anchor link that was
clicked. Can anyone help me edit it? I've tried some stuff but
couldn't get it to work. Thanks for reading!

Reply via email to