fullheight.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link href='../dist/fullcalendar.css' rel='stylesheet' />
  5. <link href='../dist/fullcalendar.print.css' rel='stylesheet' media='print' />
  6. <script src='../lib/jquery/jquery.js'></script>
  7. <script src='../lib/jquery-ui/ui/jquery-ui.js'></script>
  8. <script src='../lib/moment/moment.js'></script>
  9. <script src='../dist/fullcalendar.js'></script>
  10. <script>
  11. $(document).ready(function() {
  12. var date = new Date();
  13. var d = date.getDate();
  14. var m = date.getMonth();
  15. var y = date.getFullYear();
  16. $('#calendar').fullCalendar({
  17. header: {
  18. left: 'prev,next today',
  19. center: 'title',
  20. right: 'month,agendaWeek,basicWeek,agendaDay,basicDay'
  21. },
  22. editable: true,
  23. events: [
  24. {
  25. title: 'All Day Event',
  26. start: new Date(y, m, 1)
  27. },
  28. {
  29. title: 'Long Event',
  30. start: new Date(y, m, d-5),
  31. end: new Date(y, m, d-2)
  32. },
  33. {
  34. id: 999,
  35. title: 'Repeating Event',
  36. start: new Date(y, m, d-3, 16, 0),
  37. allDay: false
  38. },
  39. {
  40. id: 999,
  41. title: 'Repeating Event',
  42. start: new Date(y, m, d+4, 16, 0),
  43. allDay: false
  44. },
  45. {
  46. title: 'Meeting',
  47. start: new Date(y, m, d, 10, 30),
  48. allDay: false
  49. },
  50. {
  51. title: 'Lunch',
  52. start: new Date(y, m, d, 12, 5),
  53. end: new Date(y, m, d, 14, 43),
  54. allDay: false
  55. },
  56. {
  57. title: 'Birthday Party',
  58. start: new Date(y, m, d+1, 19, 0),
  59. end: new Date(y, m, d+1, 22, 30),
  60. allDay: false
  61. },
  62. {
  63. title: 'Click for Google',
  64. start: new Date(y, m, 28),
  65. end: new Date(y, m, 29),
  66. url: 'http://google.com/'
  67. }
  68. ],
  69. weekMode: 'liquid',
  70. height: calcCalendarHeight()
  71. });
  72. function calcCalendarHeight() {
  73. var h = $(window).height() - 40;
  74. console.log(h);
  75. return h;
  76. }
  77. $(window).resize(function() {
  78. $('#calendar').fullCalendar('option', 'height', calcCalendarHeight());
  79. });
  80. });
  81. </script>
  82. <style>
  83. body {
  84. margin: 20px 200px 20px 20px;
  85. text-align: center;
  86. font-size: 13px;
  87. font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
  88. }
  89. #calendar {
  90. width: 100%;
  91. }
  92. </style>
  93. </head>
  94. <body>
  95. <div id='calendar'></div>
  96. </body>
  97. </html>