dynamic-options.html 3.0 KB

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