title: Cannot set/red property 'x' of undefined (horizontal scroll)
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>