您好,登錄后才能下訂單哦!
如何理解自定義datetimepicker日期控件,相信很多沒有經(jīng)驗的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個問題。
Bootstrap v3.3.5
css
/* ======================================== ys-datetimepicker ======================================== */ .ys-datetimepicker{ position:relative; width:100%; height:32px; cursor:pointer; } .ys-datetimepicker>input.form-control{ width:100%; height:32px; background-color:#fff; border-radius: 0; cursor:pointer; border:1px solid #ccc; padding-left:10px; } .ys-datetimepicker:after{ content:""; position:absolute; top:0; right:0; display:block; width:32px; height:32px; background: url(../../p_w_picpaths/common/ys-datetime-icon.png) no-repeat center center; background-size:20px 20px; border:1px solid #ccc; } .datetimepicker.datetimepicker-dropdown-bottom-right.dropdown-menu .datetimepicker-minutes .minute.active, .datetimepicker.datetimepicker-dropdown-bottom-right.dropdown-menu .datetimepicker-hours .hour.active, .datetimepicker.datetimepicker-dropdown-bottom-right.dropdown-menu .datetimepicker-days .day.active, .datetimepicker.datetimepicker-dropdown-bottom-right.dropdown-menu .datetimepicker-months .month.active, .datetimepicker.datetimepicker-dropdown-bottom-right.dropdown-menu .datetimepicker-years .year.active{ background-p_w_picpath:none; background-color:#e64e4d; }
html
<!-- 日期控件 --> <div class="ys-datetimepicker"> <input size="16" class="form-control" type="text" value="2015-10-01" readonly=""/> </div>
javascript
$(".ys-datetimepicker input").datetimepicker({ language: "zh-CN", format:"yyyy-mm-dd", todayBtn:"linked", startView:2, minView:2, weekStart: 1, todayHighlight: 1, autoclose: 1, forceParse: 0 }); $(".ys-datetimepicker").on("click",function(e){ e.stopPropagation(); e.preventDefault(); $(this).closest(".ys-datetimepicker").find("input").datetimepicker("show"); });
看完上述內(nèi)容,你們掌握如何理解自定義datetimepicker日期控件的方法了嗎?如果還想學到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。