How to get the active #comment-cid when a comment permalink is clicked? I am trying to get the comments on my website to change color when they are active. More specifically, I am looking to do something very similar to what StackExchange sites do when you click on a notification in your inbox (like this). So what I initially tried to do, was to wrap the comment class in another div class called comment_active using an if statement to see whether the current page url contained the string "#comment-". (being that the permalink for a comment is /node/nid#comment-cid I am trying to get drupal to know what the current cid is) I am having some problems figuring out how to do this. Is placing, for example #comment-1 even part of the url? or does it just bring you to the part of the page that contains that element id? is there a way that I can have the comment.tpl.php know whether a comment is active? Or should I be doing it some other way entirely?
Try to add a custom javascript file to in theme.info file

 jQuery(document).ready(function() {
    //get the current path
    var pathname = window.location.hash;
    jQuery(pathname).next().addClass('active-comment');
    //here add your custom animation
    jQuery('.active-comment').fadeOut().fadeIn().fadeOut().fadeIn().fadeOut().fadeIn().fadeOut().fadeIn().fadeOut().fadeIn().fadeOut().fadeIn().fadeOut().fadeIn().fadeOut().fadeIn();

});


here is a plugin to animate the background color of the wrapper :here

Hope this will Help You