title: JQuery Parallax effect. OnScroll event very Laggy
body: <p>I'm trying to make a simple Parallax effect in js.</p>
  
  <p>There is my code:</p>
  
  <pre><code>function parallax(){
      $(".parallax").css("backgroundPosition","50% "+$(document).scrollTop()+"px");
  }
  parallax();
  $(window).scroll(function() {
      parallax();
  });
  </code></pre>
  
  <p><a href="https://jsfiddle.net/makitos666/whb6Ldup/3/" rel="nofollow noreferrer">https://jsfiddle.net/makitos666/whb6Ldup/3/</a></p>
  
  <p>It is fully functional, but I have a performance issue. When I make scroll with the mouse wheel, there make 100px steps, and all works well. But when I use a touchable input, like touchpad or smartphone there is much more precision, and the scroll event is triggered a lot of times. In my laptop all works well, but if you use a slow computer or Android mobile the effect is very laggy.</p>
  
  <p>Do you know if this is possible? Or do I need to change everything?</p>
  
  <p>Or if you know some responsive and mobile friendly library foor this effect, I'm interested too.</p>
  
  <p>Thank you very much!</p>