2012-10-17 174 views

回答

3

萬一貓鼬的鏈接變壞某一天最好能在這裏發表在計算器上充分答案:

的jQuery:

$(document).ready(function() { 
    var SelectedDates = {}; 
    SelectedDates[new Date('04/05/2016')] = new Date('04/05/2016'); 
    SelectedDates[new Date('05/04/2016')] = new Date('05/04/2016'); 
    SelectedDates[new Date('06/06/2016')] = new Date('06/06/2016'); 

    $('#txtDate').datepicker({ 
     beforeShowDay: function(date) { 
      var Highlight = SelectedDates[date]; 
      if (Highlight) { 
       return [true, "Highlighted", Highlight]; 
      } 
      else { 
       return [true, '', '']; 
      } 
     } 
    }); 
}); 

Css:

body 
{ 
    font-family:Arial; 
    font-size : 10pt; 
    padding:5px; 
} 

.Highlighted a{ 
    background-color : Green !important; 
    background-image :none !important; 
    color: White !important; 
    font-weight:bold !important; 
    font-size: 12pt; 
} 

HTML:

<input type='text' id='txtDate' /> 

What it looks like

小提琴:http://jsfiddle.net/jquerybyexample/cqf9d/?utm_source=website&utm_medium=embed&utm_campaign=cqf9d

相關問題