2010-03-25 5 views
2

이것은 오래된 문제입니다.하지만 이제는 나를 유령처럼 사용하고 있습니다. 트리 노드를 다른 트리 노드 위로 드래그 할 때 마우스 오버를 원하는 각 노드에 대해 실행합니다. 그래서 드래그하는 것은 왼쪽 상단이 마우스 포인터의 약간 아래쪽과 오른쪽에 있도록 마우스 포인터의 오른쪽 아래에 있습니다.Scriptaculous 끌기 : 끌기 요소를 어떻게 상쇄합니까?

아무도 도와 줄 수 있습니까? - 감사합니다

답변

0

아마도 네이티브 코드에 답변이 있지만 찾을 수 없습니다.

그래서 플러그인을 추가하여 수정했습니다. Draggable.prototype.draw

// if((!this.options.constraint) || (this.options.constraint=='horizontal')) 
//  style.left = p[0] + "px"; 
// if((!this.options.constraint) || (this.options.constraint=='vertical')) 
//  style.top = p[1] + "px"; 

if((!this.options.constraint) || (this.options.constraint=='horizontal')) 
    style.left = ((this.options.mouseOffset && point[0]) || p[0]) + "px"; 
if((!this.options.constraint) || (this.options.constraint=='vertical')) 
    style.top = ((this.options.mouseOffset && point[1]) || p[1]) + "px"; 

에이 라인을 변경하고 내가 드래그를 만들 때 난 내 자신의 사용자 지정 옵션을 설정

mouseOffset: true