Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

127 rindas
4.4 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8' />
  5. <link href='../fullcalendar.css' rel='stylesheet' />
  6. <link href='../fullcalendar.print.css' rel='stylesheet' media='print' />
  7. <script src='../lib/moment.min.js'></script>
  8. <script src='../lib/jquery.min.js'></script>
  9. <script src='../lib/jquery-ui.custom.min.js'></script>
  10. <script src='../fullcalendar.min.js'></script>
  11. <script>
  12. $(document).ready(function()
  13. {
  14. /* initialize the external events
  15. -----------------------------------------------------------------*/
  16. $('#external-events .fc-event').each(function()
  17. {
  18. // store data so the calendar knows to render an event upon drop
  19. $(this).data('event',
  20. {
  21. title: $.trim($(this).text()), // use the element's text as the event title
  22. stick: true // maintain when user navigates (see docs on the renderEvent method)
  23. });
  24. // make the event draggable using jQuery UI
  25. $(this).draggable(
  26. {
  27. zIndex: 999,
  28. revert: true, // will cause the event to go back to its
  29. revertDuration: 0 // original position after the drag
  30. });
  31. });
  32. /* initialize the calendar
  33. -----------------------------------------------------------------*/
  34. $('#calendar').fullCalendar(
  35. {
  36. header:
  37. {
  38. left: 'prev,next today',
  39. center: 'title',
  40. right: 'month,agendaWeek,agendaDay'
  41. },
  42. editable: true,
  43. droppable: true, // this allows things to be dropped onto the calendar
  44. drop: function()
  45. {
  46. // is the "remove after drop" checkbox checked?
  47. if ($('#drop-remove').is(':checked'))
  48. {
  49. // if so, remove the element from the "Draggable Events" list
  50. $(this).remove();
  51. }
  52. }
  53. });
  54. });
  55. </script>
  56. <style>
  57. body {
  58. margin-top: 40px;
  59. text-align: center;
  60. font-size: 14px;
  61. font-family: "Lucida Grande", Helvetica, Arial, Verdana, sans-serif;
  62. }
  63. #wrap {
  64. width: 1100px;
  65. margin: 0 auto;
  66. }
  67. #external-events {
  68. float: left;
  69. width: 150px;
  70. padding: 0 10px;
  71. border: 1px solid #ccc;
  72. background: #eee;
  73. text-align: left;
  74. }
  75. #external-events h4 {
  76. font-size: 16px;
  77. margin-top: 0;
  78. padding-top: 1em;
  79. }
  80. #external-events .fc-event {
  81. margin: 10px 0;
  82. cursor: pointer;
  83. }
  84. #external-events p {
  85. margin: 1.5em 0;
  86. font-size: 11px;
  87. color: #666;
  88. }
  89. #external-events p input {
  90. margin: 0;
  91. vertical-align: middle;
  92. }
  93. #calendar {
  94. float: right;
  95. width: 900px;
  96. }
  97. </style>
  98. </head>
  99. <body>
  100. <div id='wrap'>
  101. <div id='external-events'>
  102. <h4>Draggable Events</h4>
  103. <div class='fc-event'>My Event 1</div>
  104. <div class='fc-event'>My Event 2</div>
  105. <div class='fc-event'>My Event 3</div>
  106. <div class='fc-event'>My Event 4</div>
  107. <div class='fc-event'>My Event 5</div>
  108. <p>
  109. <input type='checkbox' id='drop-remove' />
  110. <label for='drop-remove'>remove after drop</label>
  111. </p>
  112. </div>
  113. <div id='calendar'></div>
  114. <div style='clear:both'></div>
  115. </div>
  116. </body>
  117. </html>