FullCalendar with ThickBox
Has anybody had any luck getting FullCalendar to work with jQuery's ThickBox?
When somebody clicks on a FullCalendar event, I would like the event d开发者_Python百科etails to open into a ThickBox window.
Any idea how to get them to work together?
b/c fullcalendar dynamically creates those after document ready, thickbox isn't able to attach its own events to it, so it doesnt work. you need to explicitly tell thickbox to attach its events in eventRender (http://arshaw.com/fullcalendar/docs/event_rendering/eventRender/) with the tb_init function (which thickbox doesnt really document). something like this should work:
$('#calendar').fullCalendar({
eventRender: function(event, element) {
tb_init(element);
}
});
hope this helps
Thank you, that kinda worked or at least got me pointed in the right direction.
All I needed to do was Init ThickBox by placing the following line of code after the Calendar closing "});"...
TB_init();
$(document).ready(function(){
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay',
firstHour: '6',
minTime: '6',
maxTime: '20'
},
editable: false,
events: [
{
title: 'All Day Event',
start: new Date(y, m, 1)
}
});
TB_init();
});
精彩评论