Keeping style applied using :hover until transition complete - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Hover Animation

Description

Keeping style applied using :hover until transition complete

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
.wrapper {<!--  w  w  w  .  j av a  2 s  . com-->
   display:inline-block;
   height:100px;
   margin:21px;
   position:relative;
   width:100px;
}

.item {
   color:Chartreuse;
   display:inline-block;
   font-family:Calibri, Arial;
   font-size:33px;
   line-height:100px;
   position:absolute;
   text-align:center;
   width:100px;
   -webkit-transition-property:padding-right, z-index;
   -webkit-transition-duration:2s;
   -webkit-timing-function:ease-in-out;
   -moz-transition-property:padding-right, z-index;
   -moz-transition-duration:2s;
   -moz-timing-function:ease-in-out;
}

.item:hover {
   padding-right:100px;
   z-index:10000;
}
</style> 
 </head> 
 <body> 
  <div class="wrapper"> 
   <div class="item" style="background-color: red;">
     Lor 
   </div> 
  </div> 
  <div class="wrapper"> 
   <div class="item" style="background-color: blue;">
     Lor 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials