css - The hover state doesn't work properly on animations -


i have element when user hover on (:hover), animate left right, element off mouse. :hover state should normal state, won't happen. wrong?

#test {     position: absolute;     top: 0;     left: 0;     width: 100px;     height: 100px;     background: red;     z-index: 20;     transition: left 1s linear; }  #test:hover {     left: 200px;     background: green; } 

enter image description here

here jsfiddle demo.

within

#test:hover {     left: 100px;     background: green; } 

you tell element go outside width of , transition forces so. if change hover transition left: 100px; work.

the transition master , hover slave ;)


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -