Css3 animations v3

by Plippie Plop

HTML

<div id="menu">

    <div class="menu-contents">
        
  <div class="menu-items">
      
      <a href="javascript:void(0);" data-url="pages/home.html" class="menu-link" data-target="page"><i class="icon-home"></i>Campagne pagina</a>
       <a href="javascript:void(0);" data-url="pages/home.html" class="menu-link" data-target="page"><i class="icon-home"></i>A very cool menu</a>
      <a href="javascript:void(0);" data-url="pages/home.html" class="menu-link" data-target="page"><i class="icon-home"></i>A very cool menu with long text</a>
      <a href="javascript:void(0);" data-url="pages/home.html" class="menu-link" data-target="page"><i class="icon-home"></i>A very cool menu also with a long part of tekst</a>
      
  </div> 
    
 
    
</div>

CSS

/* reset */
*, *:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body{
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;    
}


/* STYLE */

#menu{
    position:fixed;
    top:0;
    bottom:0;
    left:0;
    width:280px;
     background:#efefef;
}

#menu .menu-content {
position: relative;
height: 100%;
width: 100%;

-webkit-overflow-scroll: touch!important;
}

.menu-link {text-align: left;padding-right:20px;}
.menu-link {
position: relative;
color: rgb(51, 51, 51);
text-decoration: none;
display: block;
font-weight: normal;
height: 40px;
line-height: 40px;
background: rgba(249, 249, 249, 1);
border-bottom: 1px solid rgb(137, 137, 137);
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}

.menu-link i {
font-size: 24px;
width: 40px;
line-height: 40px;
text-align: center;
}

#menu .menu-link:after {
right: 0px;
content: "\f054";
}
#menu .menu-link.add-spin:after {
right: 2px;
content: "\f017";
}
.menu-link:after {
display: block;
font-family: 'fontAwesome';
position: absolute;
top: 0;
color: rgb(34, 34, 34);
width: 16px;
height: 40px;
line-height: 40px;
padding-top: 2px;
}

.menu-link:active, 
.menu-link:focus, 
.menu-link:hover {
background: rgb(56, 180, 232);
text-decoration: none;
color: white;
}


/* Animations */

.menu-link{
    position:relative;
}

.anim-bar{
display:block;
position:absolute;
    z-index:0;
 border:0px solid red;
    width:100%;
    height:40px;
    
background: -moz-linear-gradient(45deg,  rgba(255,255,255,0) 0%, rgba(255,255,255,0) 70%, rgba(255,255,255,0.5) 80%, rgba(255,255,255,0) 90%);
background: -webkit-gradient(linear, left bottom, right top, color-stop(0%,rgba(255,255,255,0)), color-stop(70%,rgba(255,255,255,0)), color-stop(80%,rgba(255,255,255,0.5)), color-stop(90%,rgba(255,255,255,0)));
background: -webkit-linear-gradient(45deg,  rgba(255,255,255,0) 0%,rgba(255,255,255,0) 70%,rgba(255,255,255,0.5) 80%,rgba(255,255,255,0)...

JavaScript

//dirty  ajax load simulation on hover:
$('.menu-link').hover( function() {
      $(this).addClass('add-spin').prepend('<span class="anim-bar"></span>');    
} ,function() {
    $(this).removeClass('add-spin').find('.anim-bar').remove();
});