2010-04-20 2 views

답변

0

수정, 실제로는 정렬 할 수 없습니다.

<ul id='test'> 
    <li> 
    <div> 
     item1 
     <script type='text/javascript'> 
      alert(0); 
     </script> 
    </div> 
    </li> 
    <li> 
    item2 
    </li> 
</ul>  
<script type = 'text/javascript'> 
    $('#test').sortable({revert: true}); 
</script> 

위 예제에서 내 응용 프로그램에는 원치 않는 두 개의 경고 (0) 팝업이 표시됩니다.

+0

나도 같은 행동을 보내고 있습니다! – Patricia

1

jquery 사용자 포럼에서 답변을 찾았습니다!

업데이트가 2 개 (원본 및 목록으로 이동) 업데이트되므로 업데이트가 두 번 실행됩니다. 옵션을하거나 업데이트에서 당신은 추가 할 수 있습니다 : 그래서, 다음 중 하나를 수행 할 수 있습니다 당신은 수신이 검사를 :

if (this === ui.item.parent()[0]) { 
    //do your stuff here 
} 

여기 스레드가 JQuery와 포럼의 : http://forum.jquery.com/topic/sortables-update-callback-and-connectwith

+0

감사합니다 패트리샤, 몇 년 후에 이것은 계속 도움이됩니다! :) – jpincheira