Fullcalendar选项不起作用

时间:2015-12-05 01:38:28

标签: javascript jquery fullcalendar

我试图使用FullCalendar。 init函数中的所有选项都不起作用。没有控制台错误,或任何类似的反馈。当我尝试使用"标题"选项,实际的标题似乎就消失了!

这是我的HTML:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>VetPro Dashboard</title>

    <!-- Style Css-->
    <link rel="stylesheet" href="../../assets/css/styles.css">
    <link rel="stylesheet" href="../../assets/fonts/fonts.css">
    <link rel="stylesheet" href="../../vendor/bower_components/fullcalendar/dist/fullcalendar.min.css">
    <link rel="stylesheet" href="../../vendor/bower_components/fullcalendar/dist/fullcalendar.print.css">

    <!-- jQuery -->
    <script type="text/javascript" src="../../vendor/bower_components/jquery/dist/jquery.min.js"></script>
    <script type="text/javascript" src="../../vendor/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../../vendor/bower_components/moment/min/moment.min.js"></script>
    <script type="text/javascript" src="../../vendor/bower_components/fullcalendar/dist/fullcalendar.min.js"></script>
    <script type="text/javascript" src="../../assets/javascripts/calendar_scheduler.js"></script>
  </head>

  <body class="split-background">

    <!-- Start Body -->
    <div class="container-fluid" id="vetpro-dashboard">
      <div class="container container-border">
        <div class="col-md-6">
          <div id="calendar">
          </div>
        </div>
        <div class="col-md-6" id="exceptions">
          <div id="scheduler">
            <div id="timepicker">
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- End Body -->

  </body>
</html>

这是我的Javascript:

(function() {
  'use strict';

    $(document).ready(function(){
        // Full calendar
        $('#calendar').fullCalendar({
            header: {
            left: 'prev,next today',
            center: 'title',
            right: 'agendaWeek,agendaDay'
        },
            dayClick: function(date, jsEvent, view) {
        alert('Clicked on: ' + date.format());
        alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);
        alert('Current view: ' + view.name);
        // change the day's background color just for fun
        $(this).css('background-color', 'red');
        }
    });


        // Moment.js locale
        moment.locale('en', {
            calendar : {
                lastDay : '[Yesterday]',
                sameDay : '[Today]',
                nextDay : '[Tomorrow]',
                lastWeek : '[last] dddd',
                nextWeek : 'dddd',
                sameElse : 'dddd'
            }
        });
    });
})();

这里有什么问题?我该如何解决这个问题?

谢谢!

1 个答案:

答案 0 :(得分:0)

看起来文档没有涵盖包括“print.css”文件会破坏其他所有内容的文档。删除该行解决了问题。