初学jQuery哪位帮帮解决下小问题 红框部分日期不能选择 怎么开启啊
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
jQuery(function(){
$("#datePicker").datePicker({
createButton:false,
clickInput:true,
setSelected: (1900, 1 - 1, 1)
});
});
这是我自定你故意的js
/**
* Copyright (c) 2008 Kelvin Luck (http://www.kelvinluck.com/)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
* .
* $Id: jquery.datePicker.js 98 2010-05-24 10:10:01Z kelvin.luck $
**/
(function($){
$.fn.extend({
/**
* Render a calendar table into any matched elements.
*
* @param Object s (optional) Customize your calendars.
* @option Number month The month to render (NOTE that months are zero based). Default is today's month.
* @option Number year The year to render. Default is today's year.
* @option Function renderCallback A reference to a function that is called as each cell is rendered and which can add classes and event listeners to the created nodes. Default is no callback.
* @option Number showHeader Whether or not to show the header row, possible values are: $.dpConst.SHOW_HEADER_NONE (no header), $.dpConst.SHOW_HEADER_SHORT (first letter of each day) and $.dpConst.SHOW_HEADER_LONG (full name of each day). Default is $.dpConst.SHOW_HEADER_SHORT.
* @option String hoverClass The class to attach to each cell when you hover over it (to allow you to use hover effects in IE6 which doesn't support the :hover pseudo-class on elements other than links). Default is dp-hover. Pass false if you don't want a hover class.
* @type jQuery
* @name renderCalendar
* @cat plugins/datePicker
* @author Kelvin Luck (http://www.kelvinluck.com/)
*
* @example $('#calendar-me').renderCalendar({month:0, year:2007});
* @desc Renders a calendar displaying January 2007 into the element with an id of calendar-me.
*
* @example
* var testCallback = function($td, thisDate, month, year)
* {
* if ($td.is('.current-month') && thisDate.getDay() == 4) {
* var d = thisDate.getDate();
* $td.bind(
* 'click',
* function()
* {
* alert('You clicked on ' + d + '/' + (Number(month)+1) + '/' + year);
* }
* ).addClass('thursday');
* } else if (thisDate.getDay() == 5) {
* $td.html('Friday the ' + $td.html() + 'th');
* }
* }
* $('#calendar-me').renderCalendar({month:0, year:2007, renderCallback:testCallback});
*
* @desc Renders a calendar displaying January 2007 into the element with an id of calendar-me. Every Thursday in the current month has a class of "thursday" applied to it, is clickable and shows an alert when clicked. Every Friday on the calendar has the number inside replaced with text.
**/
renderCalendar : function(s)
{
var dc = function(a)
{
return document.createElement(a);
};
s = $.extend({}, $.fn.datePicker.defaults, s);
if (s.showHeader != $.dpConst.SHOW_HEADER_NONE) {
var headRow = $(dc('tr'));
for (var i=Date.firstDayOfWeek; i<Date.firstDayOfWeek+7; i++) {
var weekday = i%7;
var day = Date.dayNames[weekday];
headRow.append(
jQuery(dc('th')).attr({'scope':'col', 'abbr':day, 'title':day, 'class':(weekday == 0 || weekday == 6 ? 'weekend' : 'weekday')}).html(s.showHeader == $.dpConst.SHOW_HEADER_SHORT ? day.substr(0, 1) : day)
);
}
};
var calendarTable = $(dc('table'))
.attr(
{
'cellspacing':2
}
)
.addClass('jCalendar')
.append(
(s.showHeader != $.dpConst.SHOW_HEADER_NONE ?
$(dc('thead'))
.append(headRow)