这是我的fullcalendar代码,我正尝试在Android的对话框中打开日历事件。我尝试了所有的方法和建议,但都失败了。谁能推荐一下谁在android上尝试过这个功能?目前它是在安卓onClick的事件在浏览器中打开,我想在对话框中显示。提前感谢
<html>
<head>
<script src='../jquery/jquery-1.9.1.min.js'></script>
<script src='../jquery/jquery-ui-1.10.2.custom.min.js'></script>
<script src="../jquery/jquery.ui.touch-punch.min.js"></script>
<script src='../fullcalendar/fullcalendar.min.js'></script>
<link href='../fullcalendar/fullcalendar.css' rel='stylesheet' />
<link href='../fullcalendar/fullcalendar.print.css' rel='stylesheet' media='print' />
<script src='../fullcalendar/gcal.js'></script>
<script>
$(document).ready(function() {
$('#calendar').fullCalendar({
// US Holidays
events: 'http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic',
eventClick: function(calEvent, jsEvent, view) {
alert('Event: ' + calEvent.title);
alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);
alert('View: ' + view.name);
// change the border color just for fun
$(this).css('border-color', 'red');
},
loading: function(bool) {
if (bool) {
$('#loading').show();
}else{
$('#loading').hide();
}
}
});
});
</script>
<style>
body {
margin-top: 25px;
text-align: center;
font-size: 13px;
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
}
#loading {
position: absolute;
top: 5px;
right: 5px;
font-size: 9px;
}
#calendar {
width: 100%;
margin: 0 auto;
}
</style>
</head>
<body>
<div id='loading' style='display:none'>Please Wait....Loading....</div>
<div id='calendar'></div>
</body>
</html>
发布于 2014-02-19 10:01:20
我遇到了同样的问题,下面是如何解决它的方法。
出现问题的原因是,在Adam Shaw最优秀的FullCalendar插件(v1)中,他在事件容器鼠标悬停时将事件处理程序懒惰地附加到日历事件上。问题是Android没有正确地实现mouseover事件,所以click处理程序没有初始化。
一种解决方法是将他的插件中1707行附近的代码从: container.unbind('mouseover').mouseover(function(ev) {
至
container.unbind('click').click(function(ev) {
然而,这将需要你点击一个事件来初始化任何其他事件,所以如果你在日历事件上有悬停事件(我猜你不会这样做,因为你正在做移动开发),这个方法将不起作用。
另一种方法是将以下内容添加到您的日历初始化选项中:
eventAfterAllRender: function(){
// hack to trigger event binding on android chrome, which doesn't trigger mouseover events
$('.fc-event').each(function(i, element){
$(element).trigger('mouseover', {});
})
}
这将立即触发日历中所有事件的mouseover事件,从而触发所有日历事件的attachHandler。
https://stackoverflow.com/questions/18733684
复制相似问题