javascript - 鼠标悬停在fullcallendar时如何拖动事件
问题描述
我想在鼠标悬停时拖动事件,我尝试只调用触发器 mousedown 和 mousemove 但它的方法不起作用:
var calendar = new FullCalendar.Calendar(calendarEl, {
timeZone: 'UTC',
headerToolbar: {
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay'
},
editable: true,
dayMaxEvents: true, // when too many events in a day, show the popover
events: 'https://fullcalendar.io/demo-events.json?overload-day',
eventMouseEnter: function(info ){ // when mouse over
console.log('eventMouseEnter')
$(info.el).trigger('mousedown').trigger('mousemove') // it not worked
}
});
任何帮助请求,告诉我当鼠标悬停在 FulCallendar 时如何拖动事件?
解决方案
我找到了解决方案。也许这不是更好的解决方案,但它适用于自然模拟 mousedown。
eventMouseEnter: function(info ){
console.log('eventMouseEnter')
var evt = new MouseEvent("mousedown", {
view: window,
bubbles: true,
cancelable: true,
clientX: info.jsEvent.pageX,
clientY: info.jsEvent.pageY,
/* whatever properties you want to give it */
});
info.el.dispatchEvent(evt);
}
推荐阅读
- c# - 为什么它仍然访问状态被删除的行并得到错误
- c# - WPF MultiBinding 和 IMultiValueConverter 进行布尔运算
- class - UML 中对象的类可以改变吗?
- ocaml - 什么| ocaml中的符号是什么意思?
- python - 使用 BeautifulSoup提取包含 `
` 的字符串返回 `None` - r - 在 R 中重复复制()以逐步向前/向后更改(每次更改种子)
- regex - URL 仅重写主请求并忽略子文件夹
- python - 如何使饼图的一部分透明
- javascript - 如何跳过值实时数据库firebase
- python - 如何使用基于主题的 Python 在 Outlook 中创建规则