要隐藏 previos 和 next 按钮,您可以使用 jQueries 功能按其类或 ID 隐藏元素。
$('.fc-button-prev, .fc-button-next').hide();
这样您就可以随时重新展示它们,但如果您不想使用它,只需使用 following methods 构建您的 fulclalendar
header: {
left: 'today',
center: 'prev,title,next',
right: 'month,basicDay'
},
要使用下拉菜单更改日期,请从服务器 php 端以您希望的方式填充选择,
例如我的php写这个..(只是部分代码,但是例如)
"<option <?php echo 'value=\'' . $date1 . '\'>' . $date1; ?> - Monday</option>" +
生成的 HTML 应如下所示
<option value="2012-02-27">2012-02-27 - Monday</option>
然后再次使用 jQuery 的强大功能...
$('#myDateSelector').change(function() {
var selectedText = $('#myDateSelector option:selected').text(); //Gets the TEXT
var selectedValue = $('#myDateSelector option:selected').val(); //gets the Value='abc'
var selectedDate = new Date(selectedValue);
$('#calendar').fullCalendar('gotoDate',selectedDate);
} );
Another answer of mine show more complex code on how to control fullcalendar, but it uses ASP server tags not PHP.. the JavaScript is still the same logic though.