답변 2개
채택된 답변
+20 포인트
https://jqueryui.com/datepicker/
https://api.jqueryui.com/datepicker/#option-beforeShow
beforeShow 옵션이 기대하는 기능에 도움이 될지 모르겠습니다.
Copy
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
<link rel="stylesheet" href="https://jqueryui.com/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>
<script>
$( function() {
$( "#datepicker" ).datepicker({
minDate: '+1D',
// gotoCurrent: false,
beforeShow: function (input, dpobj) {
var widget = $( "#" + input.id ).datepicker( "widget" );
setTimeout(function () {
widget.find('a.ui-state-highlight').removeClass('ui-state-highlight');
widget.find('a.ui-state-hover').removeClass('ui-state-hover');
}, 0);
}
});
} );
</script>
</head>
<body>
<p>Date: <input type="text" id="datepicker"></p>
</body>
</html>
답변을 작성하려면 로그인이 필요합니다.
