2014-01-16 28 views

回答

0

一種可能的解決方案是一類當用戶選擇一個日期添加到一個datepicker-纏繞元件和調整CSS:

$(document).ready(function() { 
    $('#txtDate').datepicker({ 
     onSelect: function() { 
      $("#txtDate").addClass("madeSelect");   
     } 
    }); 
}); 

必要的CSS調整.ui-datepicker-today:設置背景的BAC根據您使用的主題設置默認日期的kground-image。

必要的CSS調整爲.ui-datepicker-today.ui-datepicker-current-day(以防用戶選擇當前日期):將背景設置爲.ui-datepicker-current-day的主題背景圖像,並將字體的顏色設置爲當天的主題顏色。

.madeSelect .ui-datepicker-today .ui-state-highlight 
{ 
background: url("http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/sunny/images/ui-bg_gloss-wave_60_fece2f_500x100.png") repeat-x scroll 50% 50% #fece2f; 
} 
.madeSelect .ui-datepicker-today.ui-datepicker-current-day .ui-state-highlight 
{ 
background: url("http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/sunny/images/ui-bg_inset-soft_30_ffffff_1x100.png") repeat-x scroll 50% 50% #ffffff;; 
color: #0074c7; 
} 

工作演示在這裏:Datepicker - remove highlight on today when date is selected

相關問題