When new messages appear, I want them to be subtly highlighted as users hover over them. The background color will slowly disappear on hover thanks to the CSS code provided below. However, this effect should only happen once, which is why I need to remove the additional class "newmessage" that triggers the background color change. But if I remove this class on hover, I lose the gradual disappearing effect...
.newmessage {
background-color: rgba(213, 213, 213, 1);
-webkit-transition: background-color 2s ease-out;
-moz-transition: background-color 2s ease-out;
transition: background-color 2s ease-out;
}
.newmessage:hover {
background-color: rgba(213, 213, 213, 0);
}