Datepicker 년,월 선택 jQuery 2019. 6. 20. 13:57
$("#monthDate").datepicker({ 
			dateFormat: 'yy.mm',
			changeMonth: true,
		    changeYear: true,
		    showButtonPanel: true,
		    onClose: function(dateText, inst) {  
	            var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val(); 
	            var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val(); 
	            $(this).datepicker('setDate', new Date(year, month, 1));
	            $(".ui-datepicker-calendar").css("display","none");
	        }
		});
		$("#monthDate").focus(function () {
			$(".ui-datepicker-calendar").css("display","none");
			$("#ui-datepicker-div").position({
				  my: "center top",
				  at: "center bottom",
				  of: $(this)
			});
		});

'jQuery' 카테고리의 다른 글

scrollTop  (0) 2016.08.17
iframe에서 부모 element에 접근하기  (0) 2016.05.12
z-index ie7에서 엘리먼트에 가려질 때  (0) 2013.05.08
Datepicker 옵션  (0) 2013.01.16
동적으로 li 추가, 삭제하기  (0) 2012.10.18