<div style='width:20px;height:20px;position:absolute;background:red;'>

 

 

$('#boxDiv').bind('mousedown',function(){
  $(document).bind('mousemove',function(event){
    var x = event.clientX + 'px';
    var y = event.clientY + 'px';
    $('#boxDiv').css({"left":x,"top":y});
  });
  $(document).bind('mouseup',function(event){
    $(document).unbind('mousemove');
   });

});

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-02-22
猜你喜欢
  • 2021-07-24
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案