【发布时间】:2011-04-07 13:23:31
【问题描述】:
我需要一个日历插件(最好用于 jQuery 甚至更好的 WordPress),它可以在单击日期时显示营业时间。
营业时间因星期几和季节而异。
我已经查看了各种日历插件,但其中大多数是日期选择器或面向发布事件的。
【问题讨论】:
标签: javascript jquery wordpress jquery-plugins calendar
我需要一个日历插件(最好用于 jQuery 甚至更好的 WordPress),它可以在单击日期时显示营业时间。
营业时间因星期几和季节而异。
我已经查看了各种日历插件,但其中大多数是日期选择器或面向发布事件的。
【问题讨论】:
标签: javascript jquery wordpress jquery-plugins calendar
FullCalendar 会做你想做的事。
您需要为 dayClick 事件 (documentation) 设置一个处理程序。
例如:
$("#calDiv").fullCalendar(
dayClick: function(date, allDay, jsEvent, view) {
// change the day's background color just for fun
$(this).css('background-color', '#6495ED');
// assuming a call that goes to the server and gets HTML for an opening hours popup
$.ajax(
url: '/path/to/get/hours',
data: {'date' : date}, // pass the date as a param,
dataType: 'html',
success: function(data) {
$("#divForPopup").html(data).show();
}
);
}
);
或者,您可以为每天创建一个显示开放时间(或总开放时间,包括关闭时间)的事件。
【讨论】: