How to make FullCalendar work on touch devices?

心不动则不痛 提交于 2019-11-28 20:47:16

Have you tried including the Jquery UI Touch Punch?

By default, Jquery UI doesn't support Touch Events because it wasn't optimized for mobile devices. Touch Punch solved my problems with the Jquery UI Drag&Drop functionalities, which seem to be used by FullCalendar as well.

Hope it helps!

THIS WORKS

I used this plugin: jquery.ui.touch.js

adds Touch support to Fullcalendar for iOS and Android devices

just use this to initialize your calendar:

eventRender: function(event, element) {
            $(element).addTouch();
        }

Since I struggled to get this to work with jQuery UI touch punch, and I couldn't find any complete example code, I thought I'd post the code I used to make creating and dragging events work on mobile devices:

NOTE: This example uses jQuery UI touch punch.

$(document).ready(function() {

  $('#calendar').fullCalendar({
    ...
    eventAfterRender: function(event, element, view) {
      element.draggable();
    }
  });

  $('.fc-view tbody').draggable();
});

FullCalendar touch support is available in the beta release for v2.7.0 according to this FullCalendar blog post.

With latest Full Calendar 2.7.1, touch is Supported. You can even set Options for Press delays. Just look at the Docs

I used this plugin: jquery.ui.touch.js

It worked for me by this code:

$('#calendar').fullCalendar({
[...]
});

$('#calendar').addTouch();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!