Web dev/jQuery
-
jQuery / jQueryUI datepicker 데이트피커 한글설정 UI커스텀Web dev/jQuery 2022. 10. 30. 13:58
기본 데이트피커 UI는 겁나구리다. 그래서 이쁘게 커스텀을 해주었다. 게다가 영어가 기본설정이므로 한글설정도 해주었다. 1. jquery, jqueryUI를 사용하기 위해서 불러온다. 2.한글설정을 해준다. // 데이트피커 한글설정 function datepickEvt(){ $.datepicker.setDefaults({ dateFormat: 'yy-mm-dd', prevText: '이전 달', nextText: '다음 달', monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9..
-
jQuery / class 제어하기Web dev/jQuery 2022. 3. 25. 14:36
제이쿼리에는 어느정도 익숙하지만 그래도 기록으로 남기려고 한다. 주의 할점은 셀렉터에서 대상이 id인지 class인지 '#' '.' 으로 선언해줘야한다. 하지만 뒤에 메서드에는 '.' 을 안붙혀줘도 된다. 1. 클래스 추가 $('선택자').addClass('class1'); // 1개 추가 $('선택자').addClass('class1 class2'); // 여러개 추가 2. 클래스 제거 $('#선택자').removeClass('class1'); // 1개 제거 $('#선택자').removeClass('class1 class2'); // 여러개 제거 3. 클래스 교체 : 체이닝으로도 할 수 있다. $('선택자').switchClass('oldClass', 'newClass'); $('선택자').remov..