html - can css transition transform hold the end state? -


animation can ,just:

-webkit-animation-fill-mode: forwards; 

but ‘transition’ , can let div 'end' in hover state use 'transition'

.div-box{         position: relative;         top:0;         left: 0;         width: 100px;         height: 100px;         background: red;         transition:all 1s linear ;     }     .div-box:hover{         transform: translate(100px,0);     } 

you can kind of emulate behavior need following trick:

.div-box{         position: relative;         top:0;         left: 0;         width: 100px;         height: 100px;         background: red;         transition:all 1s linear 99999s; /* huge delay non-hovered state! */     }     .div-box:hover{         transform: translate(100px,0);         transition:all 1s linear; /* immediate transition start on hover */     } 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -