【问题标题】:jQuery Full calender render eventsjQuery Fullcalendar 渲染事件
【发布时间】:2014-02-24 17:19:53
【问题描述】:

我正在使用 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");
    });
  } 

【问题讨论】:

    标签: jquery fullcalendar


    【解决方案1】:

    检查此链接 Milind:

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

    Fullcalendar mousewheel bind event

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

    【讨论】:

    • 首先感谢您的回复,我不能使用鼠标滚轮事件,我的网页可以在手机或平板电脑上使用。所以它可以成为对这些用户的某种限制
    • 当然,但这意味着您可以分析代码,以便帮助您进行事件绑定。我想让你看到,例如 onclick 事件到 div/元素的绑定与 chrome 和 firefox 不同。
    猜你喜欢
    • 2013-05-26
    • 1970-01-01
    • 2015-08-07
    • 2017-05-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-22
    • 2022-01-03
    相关资源
    最近更新 更多