I am trying to make a button like the one below which on click moves the color slowly to the active button.
I took the image from here
So far i have done this fiddle
<ul>
  <li class="selected"><a href="#">HOME</a></li>
  <li><a href="#">ABOUT</a></li>
  <li><a href="#">OUR CENTRES</a></li>
  <li><a href="#">WHO, HOW, & WHAT</a></li>
</ul>
css code
  a,ul,li {
    margin: 0;
    padding: 0;
    list-style: none;
    text-decoration: none;
  }
  * {
    font-family: Arial, Helvetica;
    font-size: 12px;
  }
  li {
    position: relative;
    line-height: 40px;
    float: left;
    margin-right: -1px;
    padding: 0 15px;
  }
  li {
    display: block;
    color: blue;
    text-align: center;
  }
  a:before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: #fff;
    color: #fff;
    z-index: -1;
    transform: skew(-15deg, 0);
    -ms-transform: skew(-15deg, 0);
    -webkit-transform: skew(-15deg, 0);
  }
  li:hover a:before {
    background: green;
  }
  li:hover a {
    color: #aaa;
  }
  li a.selected:before {
   content: '';
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: #fff;
    color: #fff;
    z-index: -1;
    transform: skew(-15deg, 0);
    -ms-transform: skew(-15deg, 0);
    -webkit-transform: skew(-15deg, 0);
  }
  .selected a {
    color: #fff;
  }
  .selected {
    background-color: #10acdf;
  }
  ul {
    border-top-left-radius: 25px;
    border-bottom-left-radius: 25px;
    border-top-right-radius: 25px;
    border-bottom-right-radius: 25px;
    display: -webkit-inline-box;
    border: 1px solid #10acdf;
    overflow: hidden;
    background-color: transparent;
    font-size: 14px;
    font-weight: bold;
  }
jquery
$('li').on('click', function() {
$('li').removeClass('selected');
$(this).addClass('selected');
});
the hover is working like the image but when the button is active, the button is covered in rectangle but not as the image(angled/slanted) i have posted.And how can i work with the animation to move to the side where it is active.I am facing 2 problems.

 
    