JSFiddle - React, Tailwind, and code Playground
HTML
<div class="circle"> </div>
CSS
.circle {
width: 50px;
height: 50px;
border-radius: 100%;
background: green;
position: absolute;
}
JavaScript
var target;
$('.circle').on("touchstart", function() {
target = $(this);
});
var moove = function (obj, x, y){
$(obj).css({"left" : x });
$(obj).css({"top" : y });
}
$(window).on("touchmove", function(e) {
moove($(target), event.targetTouches[0].clientX, event.targetTouches[0].clientY );
});