$(document).ready(function () { $(".inline").colorbox({inline: true, width: '90%', maxWidth: "800px", maxHeight: "80%", fixed: true, onOpen: function () { var d = $(this).data('date'); $("#schedule-mar-date").html(d); var schedule_time_list = $(this).prev().clone(true); var schedule_time_list_popup = $("#schedule-mar").find('.schedule-time-list'); schedule_time_list_popup.replaceWith(schedule_time_list); //schedule_time_list_popup.children('li').each(function(){ // $(this).wrap('
'); //}); //schedule_time_list_popup.find('li').wrap('
'); //var date = $(this).attr("data-date"); //$.ajax({url: "./beach_time.php?date=" + date, async: false, success: function (result) { // $("#schedule-mar").html(result); // }}); }, onClosed: function () { //location.reload(true); //$("#schedule-mar").empty(); } }); }); $.htmlEntities = function (str, proc) { if ('encode' === proc) { var buffer = []; for (var i = str.length - 1; i >= 0; i--) { buffer.unshift(['&#', str[i].charCodeAt(), ';'].join('')); } return buffer.join(''); } else { return str.replace(/&#(\d+);/g, function (match, dec) { return String.fromCharCode(dec); }); } }