input 클릭시 datapicker가 노출되는데 바로 보이는 방법도 있나요? 채택완료
디자이너플러스
8년 전
조회 2,549
안녕하세요! 디자이너플러스입니다.
한가지 궁금한 점이 있는데요.
스킨만들적에 input 클릭시 datapicker가 노출되는데
input에 마우스 클릭없이도 항상 datapicker가 노출되게 하는 방법이 있나요?
</p><table><tbody><tr><td class="line-content"><p><span style="font-size: 11pt;"><input </span><span class="html-attribute-name" style="font-size: 11pt;">type</span><span style="font-size: 11pt;">="</span><span class="html-attribute-value" style="font-size: 11pt;">text</span><span style="font-size: 11pt;">" </span><span class="html-attribute-name" style="font-size: 11pt;">name</span><span style="font-size: 11pt;">="</span><span class="html-attribute-value" style="font-size: 11pt;">wr_1</span><span style="font-size: 11pt;">" </span><span class="html-attribute-name" style="font-size: 11pt;">value</span><span style="font-size: 11pt;">="" </span><span class="html-attribute-name" style="font-size: 11pt;">id</span><span style="font-size: 11pt;">="</span><span class="html-attribute-value" style="font-size: 11pt;">wr_1</span><span style="font-size: 11pt;">" </span><span class="html-attribute-name" style="font-size: 11pt;">class</span><span style="font-size: 11pt;">="</span><span class="html-attribute-value" style="font-size: 11pt;">frm_input form-control datepicker</span><span style="font-size: 11pt;">" </span><span class="html-attribute-name" style="font-size: 11pt;">size</span><span style="font-size: 11pt;">="</span><span class="html-attribute-value" style="font-size: 11pt;">50</span><span style="font-size: 11pt;">" </span><span class="html-attribute-name" style="font-size: 11pt;">placeholder</span><span style="font-size: 11pt;">=""></span></p><p><span style="font-size: 11pt;">
아무리 찾아봐도 모르겠네요ㅠ
고수님들 답변 부탁드립니다.
감사합니다.
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
채택된 답변
+20 포인트
8년 전
<script>
$(funtion(){
$("#wr_1").trigger("click");
})
</script>
위처럼 트리거 이용하시면 되실 듯 싶습니다.
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
디자이너플러스
8년 전
댓글을 작성하려면 로그인이 필요합니다.
8년 전
자문자답입니다.
</p><p><span style="color: rgb(51, 51, 51); font-family: Arial, 돋움, Dotum; font-size: 12px; background-color: rgb(247, 247, 247);"><script> </span><br style="color: rgb(51, 51, 51); font-family: Arial, 돋움, Dotum; font-size: 12px;"><span style="color: rgb(51, 51, 51); font-family: Arial, 돋움, Dotum; font-size: 12px; background-color: rgb(247, 247, 247);"> $( function() { </span><br style="color: rgb(51, 51, 51); font-family: Arial, 돋움, Dotum; font-size: 12px;"><span style="color: rgb(51, 51, 51); font-family: Arial, 돋움, Dotum; font-size: 12px; background-color: rgb(247, 247, 247);"> $( "#datepicker" ).datepicker(); </span><br style="color: rgb(51, 51, 51); font-family: Arial, 돋움, Dotum; font-size: 12px;"><span style="color: rgb(51, 51, 51); font-family: Arial, 돋움, Dotum; font-size: 12px; background-color: rgb(247, 247, 247);"> altField: "#wr_1" </span><br style="color: rgb(51, 51, 51); font-family: Arial, 돋움, Dotum; font-size: 12px;"><span style="color: rgb(51, 51, 51); font-family: Arial, 돋움, Dotum; font-size: 12px; background-color: rgb(247, 247, 247);">} ); </span><br style="color: rgb(51, 51, 51); font-family: Arial, 돋움, Dotum; font-size: 12px;"><span style="color: rgb(51, 51, 51); font-family: Arial, 돋움, Dotum; font-size: 12px; background-color: rgb(247, 247, 247);"></script> </span><br style="color: rgb(51, 51, 51); font-family: Arial, 돋움, Dotum; font-size: 12px;"><span style="color: rgb(51, 51, 51); font-family: Arial, 돋움, Dotum; font-size: 12px; background-color: rgb(247, 247, 247);"><input type="text" name="wr_1" value="" id="wr_1" class="frm_input form-control" size="50" placeholder=""> </span><br style="color: rgb(51, 51, 51); font-family: Arial, 돋움, Dotum; font-size: 12px;"><span style="color: rgb(51, 51, 51); font-family: Arial, 돋움, Dotum; font-size: 12px; background-color: rgb(247, 247, 247);"><div id="datepicker"></div> </span> </p><p>
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
트리거를 사용하면 첫화면에서만 반응하고
다른 화면을 클릭하면 다시 사라지더라구요.
그래서 지금 찾아본 방법은
<script>
$( function() {
$( "#datepicker" ).datepicker();
altField: "wr_1"
} );
</script>
<input type="text" name="wr_1" value="" id="wr_1" class="frm_input form-control" size="50" placeholder="">
<div id="datepicker"></div>
요렇게 해봤는데
고정은 되지만. input엔 저장이 안되네요 ㅜ