$('#drag').bind('touchmove', function(e) {
e.preventDefault();
var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
var elm = $(this).offset();
var x = touch.pageX - elm.left / 5;
var y = touch.pageY - elm.top / 5;
var width = document.body.clientWidth-60;
var height = document.body.clientHeight-60;
// console.log(x,y,width,height);
if(x>width||y>height||x<0||y<0){
return false;
}else{
$(this).css('left', x + 'px');
$(this).css('top', y + 'px');
}
});