dynamic-options.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8' />
  5. <link href='../lib/jquery-ui/themes/cupertino/jquery-ui.min.css' rel='stylesheet' />
  6. <link href='../dist/fullcalendar.css' rel='stylesheet' />
  7. <link href='../dist/fullcalendar.print.css' rel='stylesheet' media='print' />
  8. <script src='../lib/moment/moment.js'></script>
  9. <script src='../lib/jquery/dist/jquery.js'></script>
  10. <script src='../dist/fullcalendar.js'></script>
  11. <script>
  12. $(document).ready(function() {
  13. var theme = false;
  14. var isRTL = false;
  15. $('#change-theme-button').on('click', function() {
  16. theme = !theme;
  17. $('#calendar').fullCalendar('option', 'theme', theme);
  18. });
  19. $('#change-dir-button').on('click', function() {
  20. isRTL = !isRTL;
  21. $('#calendar').fullCalendar('option', 'isRTL', isRTL);
  22. });
  23. $('#calendar').fullCalendar({
  24. theme: theme,
  25. isRTL: isRTL,
  26. header: {
  27. left: 'prev,next today',
  28. center: 'title',
  29. right: 'month,agendaWeek,agendaDay'
  30. },
  31. defaultDate: '2014-06-12',
  32. editable: true,
  33. events: [
  34. {
  35. title: 'All Day Event',
  36. start: '2014-06-01'
  37. },
  38. {
  39. title: 'Long Event',
  40. start: '2014-06-07',
  41. end: '2014-06-10'
  42. },
  43. {
  44. id: 999,
  45. title: 'Repeating Event',
  46. start: '2014-06-09T16:00:00'
  47. },
  48. {
  49. id: 999,
  50. title: 'Repeating Event',
  51. start: '2014-06-16T16:00:00'
  52. },
  53. {
  54. title: 'Meeting',
  55. start: '2014-06-12T10:30:00',
  56. end: '2014-06-12T12:30:00'
  57. },
  58. {
  59. title: 'Lunch',
  60. start: '2014-06-12T12:00:00'
  61. },
  62. {
  63. title: 'Birthday Party',
  64. start: '2014-06-13T07:00:00'
  65. },
  66. {
  67. title: 'Click for Google',
  68. url: 'http://google.com/',
  69. start: '2014-06-28'
  70. }
  71. ]
  72. });
  73. });
  74. </script>
  75. <style>
  76. body {
  77. margin: 0;
  78. padding: 0;
  79. font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
  80. font-size: 14px;
  81. }
  82. #calendar {
  83. width: 900px;
  84. margin: 40px auto;
  85. }
  86. </style>
  87. </head>
  88. <body>
  89. <button id='change-theme-button'>change theme</button>
  90. <button id='change-dir-button'>change dir</button>
  91. <div id='calendar'></div>
  92. </body>
  93. </html>