I'm using the AnythingSlider tool and am having some trouble with the css and js on this. Basically, the slider has a number of navigation tabs that help jump from slide to slide. I want to change this so that when a coldfusion conditional runs, certain tabs will either remain in a default state or become inactive (change color of tab to grey, not let anything happen when user clicks on that tab.)
So basically, my CF would be something like
<cfif #X# is ""> //if true, make tab #2 not clickable, change color to grey
//else, if false, keep tab normal.
The slider is basically set up in html like this:
<ul>
<li></li> //slide #1
<li></li> //slide #2 etc etc
</ul>
I had the idea that maybe I could set up a class li class="false" as an example and have two li tags per 'slide' (show one if x is true, the other if not.)
So, I'm not sure if this makes sense but mostly, I need a hand manipulating the CSS. The code for the slider tabs looks like:
div.anythingSlider.activeSlider .thumbNav a.cur, div.anythingSlider.activeSlider .thumbNav a {
background-color: #7C9127;
}
UPDATE Well, I don't get it. This is the code at the end of my page (just before ending BODY tag. I threw some alerts in there just to make sure the code runs and it does. But, nothing happens. Tabs don't become inactive and color never changes.
I altered anythingslider.css to include this:
div.anythingSlider.activeSlider .thumbNav a.false,
div.anythingSlider.activeSlider .thumbNav a.false:hover { background: #555; }
and this is at the bottom of my main page. This script is wrapped in some cfoutput tags:
<cfif #selected_main_details.X# IS "">
settab(3, false);
<cfelse>
settab(3, true);
</cfif>
function settab(num, enable){
var panel = $('.thumbNav a.panel' + num);
if (enable){
panel
.removeClass('false')
.unbind('click')
.bind('click', function(){
panel.closest('.anythingSlider').find('.anythingBase').data('AnythingSlider').gotoPage(num);
return false;
})
} else {
panel
.addClass('false')
.unbind('click focusin')
.bind('click', function(){
return false;
})
}
}