[QUOTE=ASHKANLAEI;2425356]کار میکنه؟[JAVASCRIPT]window.addEventListener('move', function(e) {if (e.buttons != 1) return;
var square = document.getElementById('square');
square.style.left = e.offsetX;
square.style.top = e.offsetY;
خیر کار نمیکنه

از سایت های خارجی چیزایی پیدا کردم ولی نمیدونم چرا استفاده میکنم کار نمیکنه
$(document).ready(function(){
$
('#test').on('mousedown',function(e){
$this
= $(this);
$
(document).bind('mousemove',function(e){
var left = e.pageX -($this.width()/2);
var top = e.pageY -($this.height()/2);
$
('#test').css({
'left': left +'px',
'top': top +'px'
});
});
});
$
(window).on('mouseup',function(e){
$
(document).unbind('mousemove');
});
});

لینک سایت

https://stackoverflow.com/questions/...e-using-jquery