Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
900 views
in Technique[技术] by (71.8m points)

css - Complete sticky header on FullCalendar scheduler

There is a similar question here Sticky Header on Fullcalendar scheduler but the suggested answer does not work. FullCalendar provides stickyHeaderDates (https://fullcalendar.io/docs/stickyHeaderDates) what fixes the date-headers at the top of the calendar to the viewport while scrolling. I need the same for the calendar's tool bar. This feature was already proposed (https://github.com/fullcalendar/fullcalendar/issues/5357) but does not seem to be implemented in near future.

I tried experimenting doing it by CSS like

.fc-toolbar.fc-header-toolbar {
    position: sticky;
    top: 200px;
    z-index: 10;
}

.fc-head-container.fc-widget-header {
    position: sticky;
    top: 308px;
    z-index: 10;
    background: red;
}
.fc-timeline .fc-body .fc-scroller {
    height: 400px  !important;
}

but this just makes the calendar's tool buttons sticky and puts them out of graphical context. Could someone get me on the right track? I have a codepen for testing: https://codepen.io/craftydlx/pen/RwaqbvL

question from:https://stackoverflow.com/questions/66051799/complete-sticky-header-on-fullcalendar-scheduler

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

if you add this, it should work.

.fc .fc-toolbar.fc-header-toolbar?{
  margin-bottom: 1.5em;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 100;
}

.fc .fc-scrollgrid-section-header.fc-scrollgrid-section-sticky>*?{
  top: 34px;
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...