喜悦国际村 » XML/HTML/CSS/Js » 帮我看看吧,为什么一个可以达到拖动到我指定的地方的目的,而另外一个不行呢。只

页: [1]
leec19812005-5-14 08:49 AM
帮我看看吧,为什么一个可以达到拖动到我指定的地方的目的,而另外一个不行呢。只

帮我看看吧,为什么一个可以达到拖动到我指定的地方的目的,而另外一个不行呢。只是Points设置不同而已,不明白

<html xmlns:v>
<head>
<style>
v\:*{behavior:url(#default#VML);}
</style>
<script language="javascript">
var MOVEOBJ = null;
var MOVEFLAG = false;
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;
    var arr = new Array();
   // alert(MOVEOBJ.Points.value);
    arr = MOVEOBJ.Points.value.split(",");
    MOVEOBJ.Points.value = arr[0] + ',' + arr[1] + ',' + newX + ',' + newY + ',' + arr[4] + ',' + arr[5];
    event.returnValue = false;   
    return false;
}

function drop(){
    if(MOVEFLAG) MOVEFLAG = false;
    MOVEOBJ = null;       
    return true;
}
</script>
</head>
<body>
<v:PolyLine id='pl' filled="false" Points="0,0 100,0 200,0"
onmousedown='moveIt(this);' style="position:absolute"/>
<v:PolyLine id='p2' filled="false" Points="50,50 100,50 200,100"
onmousedown='moveIt(this);' style="position:absolute"/>  
</body>
</html>

ALPS2005-5-14 10:43 AM
对VML没有研究..........建议去别的地方看看吧

leec19812005-5-16 03:27 AM
老大,这可不行,可要好好学习哦


查看完整版本: 帮我看看吧,为什么一个可以达到拖动到我指定的地方的目的,而另外一个不行呢。只


Powered by Discuz! Archiver 6.1.0  © 2001-2006 Comsenz Inc.
Processed in 0.010834 second(s), 2 queries