Forum Moderators: open
It works...BUT...it takes two clicks for it to respond correctly. The slider works just fine, but the "selected" class isn't added until I click on one of the menu items twice. Here is the JavaScript I used:
$("a").click(function(){
$(".menu a.selected").removeClass("selected"); // remove previous class if there is any
$(this).addClass("selected"); // add class to the clicked link
return false; // this prevents browser from following clicked link
});
And here is the HTML:
<ul class="menu">
<li class="day1"><a class="selected xtrig" href="#1" rel="coda-slider-1">Day 1</a></li>
<li class="day2"><a class="xtrig" href="#2" rel="coda-slider-1">Day 2</a></li>
<li class="day3"><a class="xtrig" href="#3" rel="coda-slider-1">Day 3</a></li>
<li class="day4"><a class="xtrig" href="#4" rel="coda-slider-1">Day 4</a></li>
</ul>
</div