i want to change the border color of my div when i click on it with this function but when i click on one of the 3 divs the border color is much brighter.
Every Border fades the color but only the active not. Why?
Here is my Fiddle: Fiddle Demo
$('.re').click(function() {
$('.re').removeClass('active').removeAttr('style');
$(this).addClass('active');
});
$(".test1").click(function() {
$(".mainNavitem").stop().animate({"border-right-color":"rgba(255,255,255, 0.2)"}, 800);
$(".active").stop().animate({"backgroundColor":"transparent"}, 800);
$(".bg").stop().animate({"backgroundColor":"rgb(199, 55, 59)"}, 800);
});
$(".test2").click(function() {
$(".mainNavitem").stop().animate({"border-right-color":"rgba(255,255,255, 0.5)"}, 800);
$(".active").stop().animate({"backgroundColor":"transparent"}, 800);
$(".bg").stop().animate({"backgroundColor":"rgb(199, 55, 59)"}, 800);
});
$(".test3").click(function() {
$(".mainNavitem").stop().animate({"border-right-color":"rgba(255,255,255, 1)"}, 800);
$(".active").stop().animate({"backgroundColor":"transparent"}, 800);
$(".bg").stop().animate({"backgroundColor":"rgb(199, 55, 59)"}, 800);
});