Home › Forums › JavaScript › jQuery Dropdown question… › Re: jQuery Dropdown question…
a little bit better…
jQuery:
$(‘#profile a’).click(function(){
if ($(‘.sub-navigation’).is(":hidden")){
$(‘.sub-navigation’).show();
$(‘#profile’).addClass("selectedbgcolor");
$(‘#profile a:first’).addClass("selectedfontcolor");}
else {
$(‘.sub-navigation’).fadeOut();
$(‘#profile’).removeClass("selectedbgcolor");
$(‘#profile a:first’).removeClass("selectedfontcolor");}
});
CSS:
.selectedbgcolor {
background-color: #888888;
}
.selectedfontcolor {
color: #FFFFFF;
}
I can’t get .selectedfontcolor to work. Also, I would like for .selectedbgcolor to fadeOut just like the sub-nav does instead of just being removed.. I’m new to jQuery and JS so excuse me if I don’t know what I am doing :)