简体   繁体   English

单击按钮上的Bootstrap完整日历视图

[英]Bootstrap full calendar view on click button

I am trying to make a full Calendar appear when the user clicks on view appointment button, the calendar appears but at first I can only see the month, week, day links and then on clicking on them links I see a calendar - but I want the full calendar to be seen as soon as the user clicks on view appointment button 我试图在用户点击查看约会按钮时显示完整的日历,日历出现但是起初我只能看到月,周,日链接然后点击它们链接我看到日历 - 但我想要用户单击查看约会按钮后立即查看完整日历

    $('#viewAvailableAppointments').click(function () {
    $('#page-four').slideUp(500);

    $('.calendar').show();
})

$('.calendar').fullCalendar({

    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay'
    },
    editable: true
})

and my HTML code is 我的HTML代码是

<div hidden class="calendar" text-align="center"></div>

<link rel="stylesheet" href="/static/css/fullcalendar.css">
<link rel="stylesheet" href="/static/css/fullcalendar.min.css">
<link rel="stylesheet" href="/static/css/fullcalendar.print.css">
<script src="/js/jquery-1.11.2.min.js"></script>
<script src="/js/jquery-ui.min.js"></script>
<script src="/js/appointments.js"></script>
<script src="/js/fullcalendar.min.js"></script>
<script src="/js/fullcalendar.js"></script>

I also see there is an issue with CSS files, as the month, week and day are supposed to be buttons but they come up as "monthweekday" in the html page 我也看到CSS文件存在问题,因为月,周和日应该是按钮,但它们在html页面中出现为“monthweekday”

The full calendar during initialization may need some DOM elements that aren't visible. 初始化期间的完整日历可能需要一些不可见的DOM元素。 Running fullcalendar after click is correct solution: 点击后运行fullcalendar是正确的解决方案:

   $('#viewAvailableAppointments').click(function () {
    $('#page-four').slideUp(500);

$('.calendar').show();
$('.calendar').fullCalendar({
header: {
    left: 'prev,next today',
    center: 'title',
    right: 'month,agendaWeek,agendaDay'
},
editable: true

}) }) })})

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM