【发布时间】:2016-10-03 10:01:33
【问题描述】:
重现问题。
转到:
http://taitems.github.io/jQuery.Gantt/
并将以下代码粘贴到控制台。
$('.dataPanel').on('click', function(e) {
var elm = $(this);
$('.row.desc').children().filter(function() {
if ($(this).offset().top < e.pageY && ($(this).offset().top + 25) > e.pageY) {
console.log($(this).html());
}
});
$('.row.date').filter(function() {
if ($(this).offset().left < e.pageX && $(this).offset().left + 25 > e.pageX ) {
console.log($(this).html());
}
});
});
现在点击甘特图中的一些空白区域。控制台会输出被点击的日期和相应的描述。
当您向下滚动页面只是为了隐藏日期标题然后单击空白区域时,就会出现问题。
像这样
以下错误将被抛出。
jquery.fn.gantt.js:386 Uncaught TypeError: Cannot read property 'className' of null
是什么原因造成的?
【问题讨论】:
标签: javascript jquery gantt-chart