Notice
Recent Posts
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- jstl
- 이클립스
- 자바
- 면접
- java
- 버튼
- springboot
- 셋업
- 알고리즘
- 제이쿼리
- Oracle
- 오라클
- jsp 내부객체
- 필터체인
- 자바스크립트
- 설치
- 설정
- SESSION
- 마이바티스
- jquery
- 깃허브
- EL태그
- html
- 폼태그
- 스프링
- Eclipse
- 깃허브 간단요약
- jsp
- Spring
- MySQL
Archives
- Today
- Total
은은하게 코드 뿌시기
sortable 본문
728x90
tr 로 y축 이동 샘플
$('.sortlist').sortable({
handle: '.moviemove1',
axis: 'y',
opacity: 0.7,
helper: function(e, ui) {
ui.children().each(function(index) {
$(this).width($(this).width());
});
return ui;
},
start: function(e, ui) {
ui.item.addClass('current');
},
stop: function(e, ui) {
ui.item.removeClass('current');
updateMoviesort($(this));
}
}).disableSelection();
<table>
<tbody class="sortlist sortable">
<tr>
<td class="col-move">
<a href="#" class="icon_button sorter move moviemove1">
<i class="up">상</i><i class="down">하</i></a>
</td>
</tr>
</tbody>
</table>
li 좌우로 움직이기
$('.ui-sortable2').sortable({
handle: '.ui-sortable-handle2',
opacity: 0.7,
helper: "clone", // 드래그 시 복사본을 만들어 이동 가능하게 함
start: function (e, ui) {
ui.item.addClass('current');
},
stop: function (e, ui) {
ui.item.removeClass('current');
updateImageSortcnt();
}
}).disableSelection();
console.log(typeof $().sortable);
$('body').on('mousedown', '.ui-sortable-handle2', function (e) {
e.preventDefault(); // 클릭 시 기본 동작 제거 (드래그 방해 요소 제거)
});
<li>
<ul class="hide sortable ui-sortable2">
<div class="caption"><a href="#" class="icon_button sorter move ui-sortable-handle2">
<i class="left">좌</i><i class="right">우</i></a></div>
</ul>
</li>
체크포인트 :
sortable을 선언하는 지점, ->> 해당지점 클래스에 sortable 주기
handle을 선언하는 지접 ->> 움직임이 필요한곳의 클래스를 handle에주기
기본이벤트 삭제해주기
728x90
'웹 > JSP' 카테고리의 다른 글
addback, add 자기자신 포함하기 (0) | 2024.10.22 |
---|---|
소수점 두째자리 얼럿 (0) | 2024.08.08 |
자바스크립트 yes or no / OK or Cancel 함수 confirm (0) | 2024.08.06 |
자바스크립트 날짜 / 연월일시분초 받아오기. YYYYMMDDHHmmssSSS (0) | 2024.04.23 |
FORM 태그 ACTION 없을때 잊으면 바보 (0) | 2024.04.18 |
Comments