jQuery Fullcalendar呈现事件

时间:2014-02-23 09:35:13

标签: jquery fullcalendar

我正在使用jQuery 1.7.2和Full Calender 1.6.4。现在我正在尝试添加点击事件和双击事件,但我无法成功。

我尝试了下面的工作,但它在FF中工作但在IE中不起作用

eventRender: function (event, element) {
    element.bind('click', function () {
      var doubleClickOpportunity = 200, // Adjust this to whatever feels right
      clicker = element.data('clicker'); // Holder for the doubleclick setTimeout


      if (clicker) {
        // If there's a setTimeout stored in clicker, then this is a double click
        clearTimeout(clicker);
        element.data('clicker', '');
        element.trigger('doubleclick');
      } else {
        // Otherwise, it's either a single click or the beginning of a double click

        // So set a timer to decide which it is - if the timer runs out,
        // it's just a single click.
        element.data('clicker', setTimeout(function () {
          element.data('clicker', '');
          element.trigger('singleclick');
        }, doubleClickOpportunity));
      }
    });
    element.bind('doubleclick', function (e) {//dblclick
      if (!confirm(Res.deleteEvent))
        return false;


      $('#calendar').fullCalendar('removeEvents', event.id);
    });
    element.bind('singleclick', function (e) {
      alert("I am click");
    });
  } 

1 个答案:

答案 0 :(得分:0)

检查此链接Milind:

这是将滚动事件绑定到日历,也许它可以帮助你做你想做的事。

Fullcalendar mousewheel bind event

请注意,Firefox中的绑定事件与Chrome / IE不同。