jQuery插件FullCalendar日程表


jQuery插件FullCalendar日程表實現可擴展Google日歷功能

jQuery日歷FullCalendar插件是一個非常不錯的日歷工具,可用於制作日程表或計划安排等,可擴展Google日歷功能,制作個性化的日程表,同時可綁定點擊事件或拖動事件,使用非常方便。

jQuery插件FullCalendar在線實例FullCalendar v1.5.2
http://arshaw.com/fullcalendar/

使用說明
需要使用jQuery庫文件和jQuery UI庫文件和FullCalendar庫文件
http://jquery.com/
http://plugins.jquery.com/project/fullcalendar
http://ui.jquery.com/

同進需要使用fullcalendar.css文件

使用實例
一,導入css樣式和js
fullcalendar
的樣式表:
<link rel='stylesheet' type='text/css' href='redmond/theme.css' />

<link rel='stylesheet' type='text/css' href='../fullcalendar.css' />
fullcalendar
插件的基礎:

<script type='text/javascript' src='../jquery/jquery.js'></script>

<script type='text/javascript' src='../jquery/ui.core.js'></script>

<script type='text/javascript' src='../jquery/ui.draggable.js'></script>

<script type='text/javascript' src='../jquery/ui.resizable.js'></script>
fullcalendar
插件的js

<script type='text/javascript' src='../fullcalendar.min.js'></script>

二頁面加載初始化fullcalendar
<script type='text/javascript'>

 

    $(document).ready(function() {

   

       var date = new Date();

       var d = date.getDate();

       var m = date.getMonth();

       var y = date.getFullYear();

      

       $('#calendar').fullCalendar({

           header: {

              left: 'prev,next today',

              center: 'title',

              right: 'month,agendaWeek,agendaDay'

           },

           editable: true,

           events: [

              {

                  title: 'All Day Event',

                  start: new Date(y, m, 1)

              },

              {

                  title: 'Long Event',

                  start: new Date(y, m, d-5),

                  end: new Date(y, m, d-2)

              },

              {

                  id: 999,

                  title: 'Repeating Event',

                  start: new Date(y, m, d-3, 16, 0),

                  allDay: false

              },

              {

                  id: 999,

                  title: 'Repeating Event',

                  start: new Date(y, m, d+4, 16, 0),

                  allDay: false

              },

              {

                  title: 'Meeting',

                  start: new Date(y, m, d, 10, 30),

                  allDay: false

              },

              {

                  title: 'Lunch',

                  start: new Date(y, m, d, 12, 0),

                  end: new Date(y, m, d, 14, 0),

                  allDay: false

              },

              {

                  title: 'Birthday Party',

                  start: new Date(y, m, d+1, 19, 0),

                  end: new Date(y, m, d+1, 22, 30),

                  allDay: false

              },

              {

                  title: 'Click for Google',

                  start: new Date(y, m, 28),

                  end: new Date(y, m, 29),

                  url: 'http://google.com/'

              }

           ]

       });

      

    });

 

</script>

<style type='text/css'>

 

    body {

       margin-top: 40px;

       text-align: center;

       font-size: 14px;

       font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;

       }

 

    #calendar {

       width: 900px;

       margin: 0 auto;

       }

 

</style>
三添加fullcaledar容器

<div id='calendar'></div>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM