title: Slider with touch function
body: <p>I have created a simple slider. I want it also for smartphones and not only for desktops. So in this case it should be possible to let it slide when you move your finger from left to right or from right to left. For now it only works when you click on buttons.</p>
  
  <p>I have no idea how to start with it. How can I do this?</p>
  
  <pre><code>var i = 0;
  $('.next').bind('click', function() {           
    if (i &lt; 4) {      
          $('li').animate({'left': '-=600px'}, 300).delay(600);  
      i++;
    }
    console.log($('li:first').position().left);
    console.log(i);
  });
  
  $('.back').bind('click', function() {
      if (i &gt; 0) {
      if ($('li:first').position().left &lt; 0) {    
        $('li').animate({'left': '+=600px'}, 300).delay(600);
        i--;
      }
    }
    console.log(i);
  });
  </code></pre>
  
  <p><a href="https://jsfiddle.net/6t1wx95f/11/" rel="nofollow noreferrer">https://jsfiddle.net/6t1wx95f/11/</a></p>
  
  <p>PS: It should work without using a plugin.</p>