本文介紹了jquery Datepicker如何設置一些日期來突出顯示?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我正在使用 jquery Datepicker [鏈接:
I'm use jquery Datepicker [link:http://docs.jquery.com/UI/Datepicker] now,and if I want Set some date to highlight, not just highlight the date now, how can I set the option?
For example:
There I want 24/09/2011, 25/09/2011 and 27/09/2011 to highlight.
解決方案
You'll have to use the beforeShowDay
option:
var dates = []; // array of the dates you want to highlight, stored as strings
$('selector').datepicker({
beforeShowDay: function(date) {
if ($.inArray(date.toString(), dates) != -1) {
return [true, 'highlight'];
}
}
});
See this question for more information:
Can the jQuery UI Datepicker be made to disable Saturdays and Sundays (and holidays)?
這篇關于jquery Datepicker如何設置一些日期來突出顯示?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯(lián)網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!