[jQuery] sortable
2020. 3. 16. 14:40ㆍjQuery
<script>
$(태그).sortable({
handle: '', // 버튼으로만 이동되도록
cancel: '', // handle 속성 사용시 필요
start: function(event,ui) {
ui.item.toggleClass("highlight"); // 드래그선택
},
stop: function(event,ui) {
ui.item.toggleClass("highlight"); // 드래그선택해제
},
helper: function(event,ui) { // 너비 깨지지 않도록
ui.children().each(function() {
$(this).width($(this).width());
});
return ui;
},
update: function(event,ui) { // 어떠한 변경이 일어났을 때 실행시킬 이벤트
}
});
</script>
'jQuery' 카테고리의 다른 글
[jQuery] 동적으로 생성된 태그의 이벤트 처리하기 (0) | 2020.03.16 |
---|---|
[jQuery] 이미지 업로드시 미리보기 (0) | 2020.03.16 |