javascript - Hover on element A, change the style of element B with fade out animation? -


Is it possible when I hover on A, replace the style of B with animation? Like:

  & lt; Div id = "a" & gt; Div A & lt; / Div & gt; & Lt; Div & gt; Random other elements & lt; / Div & gt; & Lt; Div & gt; Random other elements & lt; / Div & gt; & Lt; Div & gt; Random other elements & lt; / Div & gt; & Lt; Div id = "b" & gt; Divi B & lt; / Div & gt;  

When I take my cursor over to A, do I want to reddish the color of white from red to white in 2 seconds?

I read, it works fine, but no animation happens when the hover event is over.

  #b {background: orange; } #A: Hover ~ # B {Infection: Background 2S Easy; Background: #fff}  


Comments