gpt4 book ai didi

javascript - 事件在 fullCalendar 中渲染得过于靠右

转载 作者:行者123 更新时间:2023-11-28 06:44:10 25 4
gpt4 key购买 nike

当我将事件渲染到日历上时,我遇到了一个奇怪的问题。大约 90% 的情况下一切都很好:

enter image description here

但是,另外 10% 的情况下,事件会渲染到距各自列右侧太远的位置:

enter image description here

有人遇到过这个问题吗?我不怀疑这是我的代码,因为它大部分时间都在工作。我也相信每个浏览器都会出现这个问题。

下面是我的代码的基本轮廓:

var myEvent = {
title: nthClass.prefix.toUpperCase() + ' ' + nthClass.number + ':' + nthClass.section + '\nCRN: ' + nthClass.crn,
start: moment().date(objectMonthDay).day(selectedCourseDayOfWeek).hour(Number(hourStart)).minute(Number(minuteStart)).second(0),
end: moment().date(objectMonthDay).day(selectedCourseDayOfWeek).hour(Number(hourEnd)).minute(Number(minuteEnd)).second(0),
textColor: '#EAE6DC',
backgroundColor: backgroundColors[i],
borderColor: "#7f8c8d"
}
$('#calendar').fullCalendar('renderEvent', myEvent);

最佳答案

看来我已经找到了解决这个问题的办法了。

最初我以为我添加的 CSS 不起作用,但经过一段时间的传播后,它现在似乎工作得很好。经过大约 30 次尝试复制该问题后,我没有遇到像以前那样的任何问题。

以下 CSS 用于修复渲染到右侧太远的事件:

#calendar > div.fc-view-container > div > table > tbody > tr > td > div > div > div.fc-content-骨骼 > table > tbody > tr > td > div > a {
左:0!重要;
}

关于javascript - 事件在 fullCalendar 中渲染得过于靠右,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33536499/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com