i wrote a code for fading effect on a div in jquery.
$("#trigger").click(function(e){
$("#divid").parent().css("background-color","#D18F8F");
console.log($("#divid").parent().css("background-color"));
e.preventDefault();
$('html, body').animate({scrollTop:$("#divid").offset().top},'slow');
$("#divid").parent().css("transition","background-color 2s linear");
$("#divid").parent().css("background-color","transparent");
});
when first time i clicked on #trigger it worked as expected, but next time i clicked on trigger it is just not working.
here is console output
rgb(209, 143, 143) for the first time and rgba(0,0,0,0) for all next time.
EDIT: here is the fiddle