You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Angular中移除FullCalendar timeGridWeek视图的头部滚动条?

移除FullCalendar timeGridWeek视图头部的无意义滚动条

这个问题通常是头部日期容器的溢出设置或宽度计算偏差导致的,你可以通过以下CSS方案修复:

  • 直接隐藏头部容器的水平滚动条
.fc-timegrid-view .fc-scrollgrid-section-header {
  overflow-x: hidden;
}
  • 强制头部表格和容器占满宽度,避免溢出
.fc-timegrid-view .fc-scrollgrid {
  width: 100% !important;
}
.fc-timegrid-view .fc-scrollgrid-section-header > table {
  width: 100% !important;
  border-collapse: collapse;
}
  • 若为移动端适配导致的滚动条,调整单元格内边距
@media (max-width: 768px) {
  .fc-timegrid-view .fc-scrollgrid-section-header .fc-col-header-cell {
    padding-left: 0;
    padding-right: 0;
  }
}

如果使用的是FullCalendar v6版本,部分类名可能略有调整,若上述代码无效,可通过浏览器元素面板定位到产生滚动的头部容器,直接对其设置overflow-x: hidden即可。

内容的提问来源于stack exchange,提问作者Tim

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.20 03:52:37