fullheight.html 2.0 KB

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