title: how to give an animation effect when <li> moves to top or bottom
body: <p>how to give an animation effect when li moves to top or bottom.</p>
  
  <p>please check my <a href="https://fiddle.jshell.net/kannankds/4s2433x2/1/">fiddle </a>, here I'am trying to add an animation effect when <code>li</code> moves bottom or top on click event.</p>
  
  <p><strong>index.html</strong>:</p>
  
  <pre><code>&lt;ul class="kds"&gt;
  &lt;li&gt;tile dtls1&lt;/li&gt;
  &lt;li&gt;tile dtls2&lt;/li&gt;
  &lt;li&gt;tile dtls3&lt;/li&gt;
  &lt;li&gt;tile dtls4&lt;/li&gt;
  &lt;li&gt;tile dtls5&lt;/li&gt;
  &lt;li&gt;tile dtls6&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p><strong>script.js</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>$(document).ready(function() {
  
    $('.previous').click(function() {
      var current = $('.currentSelection');
      current.prev().before(current);
  
    });
    $('.next').click(function() {
      var current = $('.currentSelection');
      current.next().after(current);
    });
    $(".kds li").on("click", function() {
      $(".kds li").removeClass("currentSelection");
      $(this).addClass("currentSelection");
  
    });
  
  });
  </code></pre>
  
  
  
  <p><strong>style.css</strong></p>
  
  <pre class="lang-css prettyprint-override"><code>.kds {
    list-style-type: none;
  }
  
  .kds li {
    padding: 5px;
    border: 1px solid gray;
    margin: 1px;
  }
  
  .currentSelection {
    background-color: gray;
  }
  </code></pre>