Trigger jQuery Qtip on FullCalendar dayClick

后端 未结 6 2039
伪装坚强ぢ
伪装坚强ぢ 2020-12-29 15:31

I have a jquery fullcalendar. I would like to trigger jquery QTip (or other jquery solution (such as a lightbox)) when I click on a day to bring up a list of options. This q

6条回答
  •  忘掉有多难
    2020-12-29 15:57

    I see two possibilities that might work out. One, you add an invisible div to the document, 20px times 20px or so. In the day click callback, you position that in the middle of the day table cell in question (get hold of it by means of $('td.fc-day' + dayNr)) and make it visible (you could also position it at the mouse pointer, maybe). Then call click() on it to make the tooltip appear.

    Second possibility: You call qtip on every table cell (by $('div.fc-content').find('td') or so) and don't use dayClick at all. Or, you combine both ideas and trigger the event for qtip in the dayClick callback.

    I would go for possibility one, I guess, because it involves fewer event listeners. However, it assumes you have the same tooltip regardless of the specific day (but the tooltip can also be configured before you show it).

    Hope that makes any sense.

提交回复
热议问题