SOURCE

console 命令行工具 X clear

                    
>
console
$(function(){
  $("div").mousedown(function(){
    var flag = true;
    $(document).mousemove(function(e){
      if(flag){
        $("div").css({ "top": e.pageY - $("div").height() * 0.5 + "px", "left": e.pageX - $("div").width() * 0.5 + "px" });
      }
		});
    $("div").mouseup(function(e){
      flag=false;
		});
});
})
<div></div>
div{
  position:fixed;
  left:50px;
  top:80px;
  width:110px;
  height:110px;
  background-color:red;
}