fullheight.html 2.1 KB

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