我需要创建一个日历,其中日期按列从上到下排列。所以我通过 div 更改了表格。砑光机工作正常。但事件显示效果不佳。事件安排在顶角 [一天]。我需要正确显示每一天的事件。并且需要创建新事件。你能帮助我吗?
function buildSkeleton(maxRowCnt, showNumbers) {
var s;
var headerClass = tm + "-widget-header";
var contentClass = tm + "-widget-content";
var i, j,k;
var table;
console.log("maxRowCnt:",maxRowCnt);
console.log("rowCnt:",rowCnt);
console.log("colCnt:",colCnt);
s =
"<div class='main1' id='body' style='width:100%' >";
for (i=0; i<rowCnt; i++) {//1
k=100/rowCnt;
s +=
"<div class='fc-week" + i + " weeks' style='width:"+ k +"% ;float:left;'>" ;
for (j=0; j<colCnt; j++) {//7
s +=
"<div class='fc-" + contentClass + " fc-day" + (i*colCnt+j) + " weekday'>" + // need fc- for setDayID
"<span class='fc- " + headerClass + "'/>"+
"<div>" +
(showNumbers ?
"<div class='fc-day-number'/>" :
''
) +
"<div class='fc-day-content'>" +
"<div style='position:relative'> </div>" +
"</div>" +
"</div>" +
"</div>" ;
}
s +=
"</div >" ;
}
s +=
"</div>";
table = $(s).appendTo(element);
console.log("table:",table);
body = table.find('.main1');
console.log("body:",body);
bodyRows = table.find('.weeks');
console.log("bodyRows:",bodyRows);
bodyCells = table.find('.weekday');
console.log("bodyCells:",bodyCells);
headCells = bodyCells.find('span');
console.log("headCells:",headCells);
bodyFirstCells = bodyCells.filter(':first-child');//bodyCells.filter(':first-child');
console.log("bodyFirstCells:",bodyFirstCells);
bodyCellTopInners = bodyRows.find('div .fc-day-content div');
console.log("bodyCellTopInners:",bodyCellTopInners);
markFirstLast(bodyRows); // marks first+last td's
bodyRows.addClass('fc-first'); // fc-last is done in updateCells
dayBind(bodyCells);
daySegmentContainer =
$("<div style='position:absolute;z-index:8;'/>")
.appendTo(element);
}