2
내가 (jQuery를에) 사용자 정의 드래그 도우미를 만드는거야에서 jQuery의 기본 도우미를 재 구현하는 방법 : 가끔 복제 할 때로는 기본 기능을하기 때문에사용자 지정 도우미
$('.dragme', element).draggable({
appendTo: 'body',
helper : custom_drag_helper,
opacity : 0.5
});
내가이 일을 해요 , 즉 원래 요소를 드래그하십시오.
function custom_drag_helper() {
if (/*criteria on when to move instead of clone */) {
return $(this); /* this is what helper: 'original' seems to do */
} else {
clone = $(this).clone(); /* this is what helper: 'clone' does */
return clone;
}
}
하지만 원래의 기능을 전혀 사용할 수 없습니다. 반환 클론() 잘 작동하지만 반환 $ (이) 기쁨을 제공합니다.