I am creating ajax rudimentary calendar using jquery and colorbox. Here is a link to the current site:
http://208.79.237.222/calendar/
When the user clicks on the link in the calendar controls, the script requests this page via ajax and updates the calendar.
The problem I am facing is the pop-up links in the calendar table. When you first load the page (http://208.79.237.222/calendar/), the links work fine, as expected, opening in colorbox modal mode.
However, after several months using the ajax calendar and then clicking on one of the links in the calendar table, the colorbox modal mode shows nothing but a large black screen.
very strange, I am attaching .colorbox () events as part of an ajax callback, so I don't know how this can happen
any help would be appreciated
function update_cal(evt)
{
evt.preventDefault();
var $tgt = $(evt.target);
var url_to_get;
if($tgt.is('a'))
{
url_to_get = $tgt.attr('rel');
}
else if($tgt.is('select'))
{
url_to_get = $tgt.val();
}
$('#cal-content').css({
background:'url(/media/interface_img/ajax-load.gif) no-repeat center center',
height:'500px'
}).html('');
$.get(url_to_get, {},
function(returned_data)
{
$('#large-calendar').html(returned_data);
add_cal_events();
}
);
}
function add_cal_events()
{
$('#cal-nav-previous').unbind().bind('click.prev', update_cal);
$('#cal-nav-next').unbind().bind('click.next', update_cal);
$('#cal-nav-today').unbind().bind('click.today', update_cal);
$('#cal-view-toggle').unbind().bind('click.view', update_cal);
$('#cal-print').unbind().bind('click.print', function(evt){
window.print();
evt.preventDefault();
});
$('#cal-category-select').unbind().bind('change.filter', update_cal);
$('#cal-category-clear').unbind().bind('click.clear', update_cal);
$('a.trigger-modal').unbind().colorbox(
{
transition : 'none',
title : false,
width : 500,
height : 380,
iframe : true,
photo : false,
opacity : 0,
scrolling : true
}
);
}
$(document).ready(function() {
add_cal_events();
});