Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery Dropdown question… Re: jQuery Dropdown question…

#59574
Eraser35
Member

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 :)