以下是示例代码:
$('a').mousedown(function(event)
{
event.ABC = true;
});
$(window).mousedown(function(event)
{
console.log("event.ABC:",event.ABC);
//outputs "undefined "
if( event.ABC)
{
// do sth
}
else
{
//let it go
}
});
<a>
元素会使窗口的点击事件不再起作用?这是你想要的吗? - pimvdb