JS - 判断鼠标指针移动离开页面
function initMouseout() {
document.body.addEventListener('mouseout', (evt) => {
if (!evt) var evt = window.event;
var to = evt.relatedTarget || evt.toElement;
if (!to || to.nodeName == "HTML") {
$('#menu_hover_bg')
.stop()
.animate({
height: '0'
}, 100);
}
});
}