title: Javascript function does not work in firefox but does in chrome, safari, IE and edge
body: <p>Could anyone tell me why this function won't execute in Firefox. The rest of the Javascript functions throughout the file work successfully except for this one (it flat out won't execute, no errors in the console). I suspected it was the <code>pageX</code> property, however that doesn't seem to be the case.</p>
  
  <pre><code>var prevX = 0;
  var i = 0;
  var drgleft = 0;
  var drgright = 0;
  
  
  function sequence_1(event){
      if(prevX == 0){
          prevX = event.pageX;
          return false;
      }  
      //drag left
      if(prevX &gt; event.pageX){
          console.log('dragged left');
          drgleft++;
          if(drgleft == 2){
              drgleft = 0;
              i--;
              if(i &lt; 0){
                  i = 30; //for optimization reasons, input the cache.length value manually (this avoids unnecessary errors in the console and laggy framerate as a result).
              } 
              document.getElementById("TheBigOne").src = cache[i].src; //use console.log(i); as a method of verifying that the code is executing correctly
          }
      }
      else if(prevX &lt; event.pageX){
          console.log('dragged right');
          drgright++;
          if(drgright == 2){
              drgright = 0;
              i++;
              if(i &gt; 30){ //for optimization reasons, input the cache.length value manually (this avoids unnecessary errors in the console and laggy framerate as a result).
                  i=0;
              }
              document.getElementById("TheBigOne").src = cache[i].src;
          }
      }
      else{
      }
      prevX = event.pageX
  }
  </code></pre>
  
  <h2>EDIT:</h2>
  
  <p>In my first post I didn't include the relevent HTML code that calls the function, for that I apologise and will implement it below.</p>
  
  <pre><code> &lt;!DOCTYPE html&gt;
      &lt;html&gt;
         &lt;body&gt;
            &lt;div class="The_main_event" draggable = "true" ondrag="sequence_1(event)" id = "GD"&gt;
  
                &lt;img src="file:///C:/Users/Harry/Desktop/Website/Web_aeroplane/Web%20Test.0031.png" id="TheBigOne"&gt;
  
             &lt;/div&gt;
      &lt;/body&gt;
    &lt;/html&gt;
  </code></pre>