我有以下代码:
area = document.createElement('div');
drag = document.createElement('div');
body.appendChild(area);
area.appendChild(drag);
area.onmouseover = function () {
console.log('entered');
}
area.onmouseout = function () {
console.log('leaved');
}
问题是,当鼠标移过孩子拖动它算作进入和离开!