calendar.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>H+ 后台主题UI框架 - 日历</title>
  7. <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
  8. <meta name="description" content="H+是一个完全响应式,基于Bootstrap3最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术">
  9. <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.7" rel="stylesheet">
  10. <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
  11. <link href="css/plugins/iCheck/custom.css" rel="stylesheet">
  12. <link href="css/plugins/fullcalendar/fullcalendar.css" rel="stylesheet">
  13. <link href="css/plugins/fullcalendar/fullcalendar.print.css" rel="stylesheet">
  14. <link href="css/animate.css" rel="stylesheet">
  15. <link href="css/style.css?v=4.1.0" rel="stylesheet">
  16. </head>
  17. <body class="gray-bg">
  18. <div class="wrapper wrapper-content">
  19. <div class="row animated fadeInDown">
  20. <div class="col-sm-3">
  21. <div class="ibox float-e-margins">
  22. <div class="ibox-title">
  23. <h5>Draggable Events</h5>
  24. <div class="ibox-tools">
  25. <a class="collapse-link">
  26. <i class="fa fa-chevron-up"></i>
  27. </a>
  28. <a class="dropdown-toggle" data-toggle="dropdown" href="calendar.html#">
  29. <i class="fa fa-wrench"></i>
  30. </a>
  31. <ul class="dropdown-menu dropdown-user">
  32. <li><a href="calendar.html#">选项1</a>
  33. </li>
  34. <li><a href="calendar.html#">选项2</a>
  35. </li>
  36. </ul>
  37. <a class="close-link">
  38. <i class="fa fa-times"></i>
  39. </a>
  40. </div>
  41. </div>
  42. <div class="ibox-content">
  43. <div id='external-events'>
  44. <p>可拖动的活动</p>
  45. <div class='external-event navy-bg'>确定活动目标</div>
  46. <div class='external-event navy-bg'>各部门职责及分工</div>
  47. <div class='external-event navy-bg'>案例分享</div>
  48. <div class='external-event navy-bg'>xxx</div>
  49. <p class="m-t">
  50. <input type='checkbox' id='drop-remove' class="i-checks" checked />
  51. <label for='drop-remove'>移动后删除</label>
  52. </p>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="ibox float-e-margins">
  57. <div class="ibox-content">
  58. <h2>FullCalendar</h2> 这是一个jQuery插件,它提供了全尺寸,可拖动,使用Ajax的操作方式,并且可以使用自己的feed格式,如谷歌日历。
  59. <p>
  60. <a href="http://arshaw.com/fullcalendar/" target="_blank">FullCalendar开发文档</a>
  61. </p>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="col-sm-9">
  66. <div class="ibox float-e-margins">
  67. <div class="ibox-title">
  68. <h5>FullCalendar示例 </h5>
  69. <div class="ibox-tools">
  70. <a class="collapse-link">
  71. <i class="fa fa-chevron-up"></i>
  72. </a>
  73. <a class="dropdown-toggle" data-toggle="dropdown" href="calendar.html#">
  74. <i class="fa fa-wrench"></i>
  75. </a>
  76. <ul class="dropdown-menu dropdown-user">
  77. <li><a href="calendar.html#">选项1</a>
  78. </li>
  79. <li><a href="calendar.html#">选项2</a>
  80. </li>
  81. </ul>
  82. <a class="close-link">
  83. <i class="fa fa-times"></i>
  84. </a>
  85. </div>
  86. </div>
  87. <div class="ibox-content">
  88. <div id="calendar"></div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. <!-- 全局js -->
  95. <script src="js/jquery.min.js?v=2.1.4"></script>
  96. <script src="js/bootstrap.min.js?v=3.3.7"></script>
  97. <!-- 自定义js -->
  98. <script src="js/content.js?v=1.0.0"></script>
  99. <script src="js/jquery-ui.custom.min.js"></script>
  100. <!-- iCheck -->
  101. <script src="js/plugins/iCheck/icheck.min.js"></script>
  102. <!-- Full Calendar -->
  103. <script src="js/plugins/fullcalendar/fullcalendar.min.js"></script>
  104. <script>
  105. $(document).ready(function () {
  106. $('.i-checks').iCheck({
  107. checkboxClass: 'icheckbox_square-green',
  108. radioClass: 'iradio_square-green',
  109. });
  110. /* initialize the external events
  111. -----------------------------------------------------------------*/
  112. $('#external-events div.external-event').each(function () {
  113. // create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)
  114. // it doesn't need to have a start or end
  115. var eventObject = {
  116. title: $.trim($(this).text()) // use the element's text as the event title
  117. };
  118. // store the Event Object in the DOM element so we can get to it later
  119. $(this).data('eventObject', eventObject);
  120. // make the event draggable using jQuery UI
  121. $(this).draggable({
  122. zIndex: 999,
  123. revert: true, // will cause the event to go back to its
  124. revertDuration: 0 // original position after the drag
  125. });
  126. });
  127. /* initialize the calendar
  128. -----------------------------------------------------------------*/
  129. var date = new Date();
  130. var d = date.getDate();
  131. var m = date.getMonth();
  132. var y = date.getFullYear();
  133. $('#calendar').fullCalendar({
  134. header: {
  135. left: 'prev,next',
  136. center: 'title',
  137. right: 'month,agendaWeek,agendaDay'
  138. },
  139. editable: true,
  140. droppable: true, // this allows things to be dropped onto the calendar !!!
  141. drop: function (date, allDay) { // this function is called when something is dropped
  142. // retrieve the dropped element's stored Event Object
  143. var originalEventObject = $(this).data('eventObject');
  144. // we need to copy it, so that multiple events don't have a reference to the same object
  145. var copiedEventObject = $.extend({}, originalEventObject);
  146. // assign it the date that was reported
  147. copiedEventObject.start = date;
  148. copiedEventObject.allDay = allDay;
  149. // render the event on the calendar
  150. // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
  151. $('#calendar').fullCalendar('renderEvent', copiedEventObject, true);
  152. // is the "remove after drop" checkbox checked?
  153. if ($('#drop-remove').is(':checked')) {
  154. // if so, remove the element from the "Draggable Events" list
  155. $(this).remove();
  156. }
  157. },
  158. events: [
  159. {
  160. title: '日事件',
  161. start: new Date(y, m, 1)
  162. },
  163. {
  164. title: '长事件',
  165. start: new Date(y, m, d - 5),
  166. end: new Date(y, m, d - 2),
  167. },
  168. {
  169. id: 999,
  170. title: '重复事件',
  171. start: new Date(y, m, d - 3, 16, 0),
  172. allDay: false,
  173. },
  174. {
  175. id: 999,
  176. title: '重复事件',
  177. start: new Date(y, m, d + 4, 16, 0),
  178. allDay: false
  179. },
  180. {
  181. title: '会议',
  182. start: new Date(y, m, d, 10, 30),
  183. allDay: false
  184. },
  185. {
  186. title: '午餐',
  187. start: new Date(y, m, d, 12, 0),
  188. end: new Date(y, m, d, 14, 0),
  189. allDay: false
  190. },
  191. {
  192. title: '生日',
  193. start: new Date(y, m, d + 1, 19, 0),
  194. end: new Date(y, m, d + 1, 22, 30),
  195. allDay: false
  196. },
  197. {
  198. title: '打开百度',
  199. start: new Date(y, m, 28),
  200. end: new Date(y, m, 29),
  201. url: 'http://baidu.com/'
  202. }
  203. ],
  204. });
  205. });
  206. </script>
  207. <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
  208. <!--统计代码,可删除-->
  209. </body>
  210. </html>