fullheight.html 2.1 KB

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