PHP群:95885625 Hbuilder+MUI群:81989597 站长QQ:634381967
    您现在的位置: 首页 > Jquery插件 > jQuery日期时间 > 正文

    jQuery日历插件FullCalendar

    作者:admin来源:网络浏览:时间:2014-04-25 17:09:40我要评论
    分享到

    内容介绍

    FullCalendar 是一个jQuery日历插件,它提供一个全尺寸,像事例中的拖拽日历。它使用 AJAX 来为每个月提取事件并轻松地配置为使用您自己资料的格式

    核心代码:
     
     
    复制代码代码如下:
    1. <!DOCTYPE html>
    2. <html>
    3. <head>
    4. <link href='fullcalendar/fullcalendar.css' rel='stylesheet' />
    5. <link href='fullcalendar/fullcalendar.print.css' rel='stylesheet' media='print' />
    6. <script src='lib/jquery.min.js'></script>
    7. <script src='lib/jquery-ui.custom.min.js'></script>
    8. <script src='fullcalendar/fullcalendar.min.js'></script>
    9. <script>
    10.  
    11.     $(document).ready(function() {
    12.     
    13.         var date = new Date();
    14.         var d = date.getDate();
    15.         var m = date.getMonth();
    16.         var y = date.getFullYear();
    17.         
    18.         var calendar = $('#calendar').fullCalendar({
    19.             header: {
    20.                 left: 'prev,next today',
    21.                 center: 'title',
    22.                 right: 'month,agendaWeek,agendaDay'
    23.             },
    24.             selectable: true,
    25.             selectHelper: true,
    26.             select: function(start, end, allDay) {
    27.                 var title = prompt('Event Title:');
    28.                 if (title) {
    29.                     calendar.fullCalendar('renderEvent',
    30.                         {
    31.                             title: title,
    32.                             start: start,
    33.                             end: end,
    34.                             allDay: allDay
    35.                         },
    36.                         true // make the event "stick"
    37.                     );
    38.                 }
    39.                 calendar.fullCalendar('unselect');
    40.             },
    41.             editable: true,
    42.             events: [
    43.                 {
    44.                     title: 'All Day Event',
    45.                     start: new Date(y, m, 1)
    46.                 },
    47.                 {
    48.                     title: 'Long Event',
    49.                     start: new Date(y, m, d-5),
    50.                     end: new Date(y, m, d-2)
    51.                 },
    52.                 {
    53.                     id: 999,
    54.                     title: 'Repeating Event',
    55.                     start: new Date(y, m, d-3, 16, 0),
    56.                     allDay: false
    57.                 },
    58.                 {
    59.                     id: 999,
    60.                     title: 'Repeating Event',
    61.                     start: new Date(y, m, d+4, 16, 0),
    62.                     allDay: false
    63.                 },
    64.                 {
    65.                     title: 'Meeting',
    66.                     start: new Date(y, m, d, 10, 30),
    67.                     allDay: false
    68.                 },
    69.                 {
    70.                     title: 'Lunch',
    71.                     start: new Date(y, m, d, 12, 0),
    72.                     end: new Date(y, m, d, 14, 0),
    73.                     allDay: false
    74.                 },
    75.                 {
    76.                     title: 'Birthday Party',
    77.                     start: new Date(y, m, d+1, 19, 0),
    78.                     end: new Date(y, m, d+1, 22, 30),
    79.                     allDay: false
    80.                 },
    81.                 {
    82.                     title: 'Click for Google',
    83.                     start: new Date(y, m, 28),
    84.                     end: new Date(y, m, 29),
    85.                     url: 'http://google.com/'
    86.                 }
    87.             ]
    88.         });
    89.         
    90.     });
    91.  
    92. </script>
    93. <style>
    94.  
    95.     body {
    96.         margin-top: 40px;
    97.         text-align: center;
    98.         font-size: 14px;
    99.         font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
    100.         }
    101.  
    102.     #calendar {
    103.         width: 900px;
    104.         margin: 0 auto;
    105.         }
    106.  
    107. </style>
    108. </head>
    109. <body>
    110. <div id='calendar'></div>
    111. </body>
    112. </html>
    113.  

    下载资源:158 下载积分:0
    转载请注明(B5教程网)原文链接:https://b5.mxunkeji.com/content-87-153-1.html
    相关热词搜索: jQuery插件 日历插件 FullCalendar