timegrid-sticky-header.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8' />
  5. <link href='../lib/main.css' rel='stylesheet' />
  6. <script src='../lib/main.js'></script>
  7. <script>
  8. document.addEventListener('DOMContentLoaded', function() {
  9. var calendarEl = document.getElementById('calendar');
  10. var calendar = new FullCalendar.Calendar(calendarEl, {
  11. height: 'auto', // enough to active sticky headers
  12. dayMinWidth: 200,
  13. slotDuration: '00:05:00',
  14. initialDate: '2020-06-12',
  15. initialView: 'timeGridWeek',
  16. nowIndicator: true,
  17. headerToolbar: {
  18. left: 'prev,next today',
  19. center: 'title',
  20. right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
  21. },
  22. navLinks: true, // can click day/week names to navigate views
  23. editable: true,
  24. selectable: true,
  25. selectMirror: true,
  26. dayMaxEvents: true, // allow "more" link when too many events
  27. events: [
  28. {
  29. title: 'All Day Event',
  30. start: '2020-06-01',
  31. },
  32. {
  33. title: 'Long Event',
  34. start: '2020-06-07',
  35. end: '2020-06-10'
  36. },
  37. {
  38. groupId: 999,
  39. title: 'Repeating Event',
  40. start: '2020-06-09T16:00:00'
  41. },
  42. {
  43. groupId: 999,
  44. title: 'Repeating Event',
  45. start: '2020-06-16T16:00:00'
  46. },
  47. {
  48. title: 'Conference',
  49. start: '2020-06-11',
  50. end: '2020-06-13'
  51. },
  52. {
  53. title: 'Meeting',
  54. start: '2020-06-12T10:30:00',
  55. end: '2020-06-12T12:30:00'
  56. },
  57. {
  58. title: 'Lunch',
  59. start: '2020-06-12T12:00:00'
  60. },
  61. {
  62. title: 'Meeting',
  63. start: '2020-06-12T14:30:00'
  64. },
  65. {
  66. title: 'Happy Hour',
  67. start: '2020-06-12T17:30:00'
  68. },
  69. {
  70. title: 'Dinner',
  71. start: '2020-06-12T20:00:00'
  72. },
  73. {
  74. title: 'Birthday Party',
  75. start: '2020-06-13T07:00:00'
  76. },
  77. {
  78. title: 'Click for Google',
  79. url: 'http://google.com/',
  80. start: '2020-06-28'
  81. }
  82. ]
  83. });
  84. calendar.render();
  85. });
  86. </script>
  87. <style>
  88. body {
  89. margin: 40px 10px;
  90. padding: 0;
  91. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  92. font-size: 14px;
  93. text-align: center;
  94. }
  95. #calendar {
  96. max-width: 1100px;
  97. margin: 0 auto;
  98. }
  99. </style>
  100. </head>
  101. <body>
  102. <p style='margin-bottom: 5em'>
  103. Demo for sticky header. Also, the bottom scrollbars stick.
  104. </p>
  105. <div id='calendar'></div>
  106. <p style='margin-top: 5em'>
  107. Cool, right?
  108. </p>
  109. </body>
  110. </html>