title: jQuery script have problems
body: <p>I used this script that I found online ( <a href="https://codepen.io/erickarbe/pen/gyfFB" rel="nofollow noreferrer">https://codepen.io/erickarbe/pen/gyfFB</a> )
  but after the first loop it just gets stuck in the middle and goes back to the start, if you give it a look it doesnt work properly, if anyone could help me figure it out it would be great ! </p>
  
  <pre><code>$jQuery.fn.liScroll = function(settings) {
    settings = jQuery.extend({
      travelocity: 0.03
    }, settings);     
    return this.each(function(){
      var $strip = jQuery(this);
      $strip.addClass("newsticker")
      var stripHeight = 1;
      $strip.find("li").each(function(i){
        stripHeight += jQuery(this, i).outerHeight(true); // thanks to Michael Haszprunar and Fabien Volpi
      });
      var $mask = $strip.wrap("&lt;div class='mask'&gt;&lt;/div&gt;");
      var $tickercontainer = $strip.parent().wrap("&lt;div class='tickercontainer'&gt;&lt;/div&gt;");                             
      var containerHeight = $strip.parent().parent().height();    //a.k.a. 'mask' width   
      $strip.height(stripHeight);         
      var totalTravel = stripHeight;
      var defTiming = totalTravel/settings.travelocity;   // thanks to Scott Waye     
      function scrollnews(spazio, tempo){
        $strip.animate({top: '-='+ spazio}, tempo, "linear", function(){$strip.css("top", containerHeight); scrollnews(totalTravel, defTiming);});
      }
      scrollnews(totalTravel, defTiming);             
      $strip.hover(function(){
        jQuery(this).stop();
      },
      function(){
        var offset = jQuery(this).offset();
        var residualSpace = offset.top + stripHeight;
        var residualTime = residualSpace/settings.travelocity;
        scrollnews(residualSpace, residualTime);
      });         
    });   
  };
  
  $(function(){
    $("ul#ticker01").liScroll();
  });
  </code></pre>