这是我的代码 - 我尝试通过两种方式调用它来匹配bootstrap 2和bootstrap 3作为一些答案之前..帮助你可以
!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">× </button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<p>Some text in the modal.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data- dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
这里是js
$(document).ready(function() {
var currentDate = $('#calendar').fullCalendar('today');
$('#calendar').fullCalendar({
dayClick: function(date, view) {
var D1 = date.format();
var D2 = moment().format('L'); // 04/20/2016
if ((new Date(D1).getTime()) <= (new Date(D2).getTime())) {
alert("this day can'tbe booked");
$(this).css('background-color', 'blue');
} else {
$(this).css('background-color', 'green');
}
我尝试了这个,但没有工作
$('#myModal').modal('show') ;
//// i tried this also but doesn't work !!!
$( "#myModal" ).on('show', function(){
alert("Show!");
});
$( "#myModal" ).on('shown', function(){
alert("Shown!");
});
},
然后是其余代码。