var MOVEOBJ = null; var MOVEFLAG = false; var CURRENTX = CURRENTY = 0; function moveIt(ob" />
麻辣堂|资源主站|开发论坛|在线手册
首页 Apache Linux Java MySQL 注册帮助 
PHP项目开发组是PHP开发资源网于2007组年建成立的项目开发团队,目前核心开发成员有27人, 项目协作成员8名.下设7个开发组,主要承接大/中型网站项目开发任务。

    由于开发任务较多,人员比较紧张,现面向社会招聘全职或者兼职开发人员,不管你是在校大学生,还是全职开发人员,以及SOHO都可以联系本站,我们可以长期合作,并为您带来丰厚的报酬。
  您现在的位置:PHP开发资源网 > 麻辣堂 > 详细资料
待解决
帮我看看为什么两次拖动的结果不同,我想得到上面那条线拖动的效果
悬赏分:20 - 2007年08月17日




<script language="javascript">
var MOVEOBJ = null;
var MOVEFLAG = false;
var CURRENTX = CURRENTY = 0;
function moveIt(obj){
document.onmousemove = move;
document.onmouseup = drop;

MOVEOBJ = obj;
CURRENTX = (event.clientX + document.body.scrollLeft);
CURRENTY = (event.clientY + document.body.scrollTop);
return true;
}

function move(){
if (MOVEOBJ == null) { return false; }
MOVEFLAG = true;
newX = (event.clientX + document.body.scrollLeft);
newY = (event.clientY + document.body.scrollTop);
// newX = event.x;
//newY = event.y;
distanceX = parseInt(newX - CURRENTX);
distanceY = parseInt(newY - CURRENTY);
var arr = new Array();
// alert(MOVEOBJ.Points.value);
arr = MOVEOBJ.Points.value.split(",");
arr_newX = parseInt(arr[2]) + distanceX ;
arr_newY = parseInt(arr[3]) + distanceY ;
MOVEOBJ.Points.value = arr[0] + ',' + arr[1] + ',' + arr_newX + 'pt,' + arr_newY + 'pt,' + arr[4] + ',' + arr[5];
CURRENTX = newX;
CURRENTY = newY;
event.returnValue = false;
return false;
}

function drop(){
alert(MOVEOBJ.Points.value);
if(MOVEFLAG) MOVEFLAG = false;
MOVEOBJ = null;
return true;
}
</script>


olyLine id='pl' filled="false" Points="0pt,0pt 100pt,0pt 200pt,0pt"
onmousedown='moveIt(this);' style="position:absolute"/>
olyLine id='p2' filled="false" Points="50pt,50pt 100pt,50pt 200pt,100pt"
onmousedown='moveIt(this);' style="position:absolute"/>

提问者:leec1981   08-17 11:11
答复
路过。。。顺便帮顶:)
回答者:玉米づ冰冻可乐 - 瓦岗村民 8-22 09:10
我也来回答:
不管你有没有帮助我们,瓦岗寨8万村民将感谢你。。。。。

为防止灌水,您需要计算一道数学题: 答案:
57 + 13 = ? 请将计算结果填在上面

 
[]
©2007 PhpRes.COM