title: Issue with horizontal scroll in image carousel
body: <p>I've tried different approaches to set up horizontal scrolling for image carouse and finally got onto this, but unfortunately I cant figure out how to resolve the following issue with <strong><a href="http://flickity.metafizzy.co/" rel="nofollow">Flickity</a></strong> image slider. The browser console shows these errors:</p>
  
  <blockquote>
    <p>Cannot set property 'x' of undefined<br>
    Cannot read property 'x' of undefined</p>
  </blockquote>
  
  <p>And those the behavior is pretty poor as you can see in this <strong><a href="http://codepen.io/anon/pen/LGbzyR?editors=101" rel="nofollow">example of codepen.io</a></strong></p>
  
  <pre><code>$('.gallery').mousewheel(function(e) {
      e.preventDefault();
      var flkty = Flickity.data(this);
  
      if (!window.wheeling) {
          // console.log('start wheeling!');
  
          if(e.deltaX &gt; 0 || e.deltaY &lt; 0){
              flkty.next();
          } else if(e.deltaX &lt; 0 || e.deltaY &gt; 0){
              flkty.previous();
          }
      }
  
      clearTimeout(window.wheeling);
      window.wheeling = setTimeout(function() {
          // console.log('stop wheeling!');
  
          delete window.wheeling;
  
          // reset wheeldelta
          window.wheeldelta.x = 0;
          window.wheeldelta.y = 0;
      }, 50);
  
      window.wheeldelta.x += e.deltaFactor * e.deltaX;
      window.wheeldelta.y += e.deltaFactor * e.deltaY;
      if(window.wheeldelta.x &gt; 500 || window.wheeldelta.y &gt; 500 || window.wheeldelta.x &lt; -500 || window.wheeldelta.y &lt; -500){
          window.wheeldelta.x = 0;
          window.wheeldelta.y = 0;
  
          if(e.deltaX &gt; 0 || e.deltaY &lt; 0){
              flkty.next();
          } else if(e.deltaX &lt; 0 || e.deltaY &gt; 0){
              flkty.previous();
          }
      }
  
      // console.log(window.wheeldelta);
  
  });
  </code></pre>
  
  <p>P.S: The code works on top of <strong><a href="http://codepen.io/anon/pen/EPNwwV" rel="nofollow">this JQuery plugin</a></strong>.</p>
  
  <p>The way I see the problem  when I tested it with a regular mouse wheel, in which actually the wheel stops at the same time when your finger stops, so despite the errors in the console log you could still easily continue to navigate, month ago I changed my mouth to Apple Magic Mouse and if I flip strong I notice like the error log is still going up counting errors and I cant continue until it reaches the end, I didnt yet tested it on notebook touchpads, but I feel like the same problem will remain there and I am looking for they way to fix it.</p>