我第一次使用Tooltipster。 https://github.com/iamceege/tooltipster
我有这个代码
$('body').on('mouseenter', '.doreming-task', function(e) {
var documentWidth = $(document).width();
var documentHeight = $(document).height();
var currentID = $(this).attr("event_id");
var atr = scheduler.getEvent(currentID);
var taskTitle = atr.text;
var taskDesc = atr.description;
var taskstartDuration = atr.start_date;
var taskendDuration = atr.end_date;
var taskdatetimeduration = scheduler.templates.tooltip_date_format(taskstartDuration).split(" ")[1] + " " + scheduler.templates.tooltip_date_format(taskstartDuration).split(" ")[2] + " - " +
scheduler.templates.tooltip_date_format(taskendDuration).split(" ")[1] + " " + scheduler.templates.tooltip_date_format(taskendDuration).split(" ")[2];
var taskAssign = atr.person;
var taskProject = atr.project_id;
var taskGroup = atr.management_id;
var taskLocation = atr.work_location_name;
var taskContent = atr.work_category;
var contents_name = "";
var management_name = "";
$.each(workContentsHolder, function(key, val) {
if (taskContent == val['id']) {
contents_name = val['name'];
return false;
} else {
contents_name = " ";
}
});
$.each(departmentHolder, function(key, val) {
if (taskGroup == val['id']) {
management_name = val['name'];
return false;
} else {
management_name = " ";
}
});
$("#task-title-holder").text(taskTitle);
$("#task-duration").text(taskdatetimeduration);
$("#task-description-holder").text(taskDesc);
$("#task-assign-holder").text(taskAssign);
$("#task-project-holder").text(taskProject);
$("#task-group-holder").text(management_name);
$("#work-content-holder").text(contents_name);
$("#work-location-holder").text(taskLocation);
$(this).tooltipster({
animation: "fade",
delay: 100,
trigger: 'hover',
content: $('#tooltip_content'),
arrow: false,
contentAsHTML: true,
repositionOnScroll: true,
trackTooltip: true,
contentCloning: true,
theme: 'tooltipster-shadow',
multiple: false,
})
});
基本上,我只是获取“ event_id”,获取所有详细信息,将其附加在HTML持有人中并将其放在内容上,它工作正常,但始终在第二个悬停上
任何帮助和帮助都将得到感谢