一、电脑版拖动
 

 
 
二、电脑版随意移动函数
 
     	var _move=false;//移动标记  
		var _x,_y;//鼠标离控件左上角的相对位置  
		$("#"+宿主id).click(function(){  
		 
			}).mousedown(function(e){  
				
			_move=true;  
			_x=e.pageX-parseInt($("#"+宿主id).css("left"));  
			_y=e.pageY-parseInt($("#"+宿主id).css("top"));  
	 
			$("#"+宿主id).fadeTo(20, 0.7);//点击后开始拖动并透明显示  
		});  
		$("#"+宿主id).mousemove(function(e){  
			if(_move){  
				var x=e.pageX-_x;//移动时根据鼠标位置计算控件左上角的绝对位置  
				var y=e.pageY-_y;  
				$("#"+宿主id).css({top:y,left:x});//控件新位置  
				console.log("移动"+宿主id+" x="+x +" y="+y);
			   
			}  
		}).mouseup(function(){  
		   _move=false;  
		 
   	  
  		});