E文搞不太懂,望高手帮助翻译一下(40分)

  • 主题发起人 主题发起人 香槟女孩
  • 开始时间 开始时间

香槟女孩

Unregistered / Unconfirmed
GUEST, unregistred user!
下面几句话来自于一篇XML教程,请高手帮忙翻译一下,万分感谢!
1、This method first ensures that there is a current entity and that the selected entity is not the entity being moved over. It then
proceeds to set the target property of the DragControl, after which it cancels the bubbling of events within the client browser.
2、This method simply sets the selected entity's X and Y coordinates to the current mouse event's X and Y coordinates. This method is called from within the move() method.
3、This method ensures that the user is actually dragging the entity by at least 5 pixels in any direction whether X, Y, positive, or negative. It then
moves the entity out of the current tree and into the body of thedo
cument. It is continuously called via the "onmousemove" event of thedo
cument object and ensures that the entity is always displayed next to the mouse cursor.
4、This method simply cleans up thedo
cument and the DragControl object. It is called whenever a drag and drop is completed or canceled.
 
function setTarget(obj) {
if(this.entity != null &&
this.entity != obj) {
this.target = obj;
}
window.event.cancelBubble = true;
}
这个method首先确认鼠标悬浮其上的实体并非鼠标所托拽的实体。(如果不是)
它就将落实托拽控件的target属性继而中止事件串在客户浏览器的继续传播。
 
2,这个方法仅仅将被选定的实体的XY坐标值付成鼠标当前的XY坐标值。这个方法在move
方法中被调用。
 
function move(obj) {
if(window.event.x < this.begin
X - 5 || window.event.x > this.begin
X + 5 ||
window.event.y < this.begin
Y -5 || window.event.y > this.begin
Y + 5 &amp;&amp;
this.enabled == false) {
obj.style.position = "absolute";
obj.style.filter = "alpha(opacity='60')";
this.setPosition();
this.enabled = true;
obj = obj.removeNode(true);
do
cument.body.appendChild(obj);
do
cument.onmouseup = function anonymous() { dragControl.endDrag() };
}
else
if(this.enabled == true) {
this.setPosition();
}
}
这个方法首先看看托拽的实体是不是已经在X,Y(的任何方向)上已经离开原点至少
5个像素。如果是,它将把托拽的实体从当前树中拔出来,托到文档中,这时文档
对象的mouseover事件会被连续触发,以确认实体仍要跟随鼠标箭头显示。
 
这个方法只是剥离document的两个鼠标事件并释放DragControl对象。当托拽完成
或中止时,此方法会被调用。
大虾,2,4句那么容易还....,你的银子可不多了。
 
接受答案了.
 

Similar threads

I
回复
0
查看
3K
import
I
I
回复
0
查看
711
import
I
I
回复
0
查看
3K
import
I
I
回复
0
查看
3K
import
I
I
回复
0
查看
1K
import
I
后退
顶部