title: How to smoothly move an object on a touchscreen display?
body: <p>The problem is my code works for computer browsers, but doesn't work for mobile browsers.
  My task is to hold my finger on an object, start moving my finger across the touch screen and see the smooth movement of the object on the screen, and when I release my finger, I can move some more objects, and not the same one.
  All events must take place in mobile browsers.
  I tried to use events such as touchmove, touchstart, but they don't work at all, since they are designed to work with touch displays.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
   &lt;head&gt;
     &lt;title&gt;LogicBuilder&lt;/title&gt;
     &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
    &lt;style&gt;
  *{
    position: absolute;
  }
  
  #ball{
  
    width:100px;
    height:100px;
    border-radius: 50%;
    background-color: blue;
    text-align: center;
    position:absolute;
    left:300px;
    top:300px;
  }
  
    &lt;/style&gt;
    
   &lt;/head&gt;
  
   &lt;body&gt;
  
    
    &lt;div id="ball"&gt;&lt;/div&gt;
  
   &lt;/body&gt; 
  &lt;script&gt;
    ball.addEventListener('mousemove', function(event) { // (1) отследить нажатие
  
  moveAt(event.pageX, event.pageY);
  
  function moveAt(pageX, pageY) {
    ball.style.left = pageX - ball.offsetWidth / 2 + 'px';
    ball.style.top = pageY - ball.offsetHeight / 2 + 'px';
  }
  
  function onMouseMove(event) {
    moveAt(event.pageX, event.pageY);
  }
  
  
  document.addEventListener('touchmove', onMouseMove);
  
  document.onmouseup = function() {
    document.removeEventListener('mousemove', onMouseMove);
    ball.onmouseup = null;
  };
  
  
  });
  
  &lt;/script&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>