title: error changedTouches[0].pageX - Uncaught TypeError: Cannot read property '0' of undefined
body: <p>I am not very knowledgeable about Javascript / jQuery and I am having a lot of trouble with a code.</p>
  
  <p>It is for a carousel mobile that I did, but the Console displays "Uncaught TypeError: Can not read property '0' of undefined" in the part of "changedTouches [0] .pageX"</p>
  
  <p>Can someone help me?</p>
  
  <pre><code>    CarouselCMS.prototype.mobileNav = function() {
      var that = this,
          diff = 0;
      this.$element.bind('touchstart', function(e){
          var initialX = e.changedTouches[0].pageX;
              initialY = e.changedTouches[0].pageY;
              dragging = true;
          that.$element.bind('touchmove', function(e) {
              if(Math.abs(initialY - e.changedTouches[0].pageY) &lt; 10 || dragging == true) {
                  if(Math.abs(initialX - e.changedTouches[0].pageX) &gt; 10 ){
                      that.$container.css("transition", "none");
                      $('body').css('overflow-y','hidden');
                      dragging = true;
                      var translate = that.translateCalc();
                      diff = initialX - e.changedTouches[0].pageX;
                      translate -= diff;
                      that.$container.css("transform","translateX("+translate+"px)");
                      console.log('x');
                  }
                  e.preventDefault();
              }else {
                  diff = 0;
                  that.$element.unbind('touchmove');
              }
          });
      });
      this.$element.bind('touchend', function(){
          that.$element.unbind('touchmove');
          $('body').css('overflow-y','auto');
          that.$container.css("transition", "transform "+(that.options.speed/1000)+"s linear");
          if(diff &gt; 100){
              that.next();
          }else if(diff &lt; -100){
              that.prev();
          }
          diff = 0;
          that.moveSlider();
      });
  }
  </code></pre>