Sample code is as following:
$('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
}
});
Though I’m not sure exactly what you want to do, I’m guessing it would be a lot easier if you didn’t have to mess with the events object. Just set up a flag variable when your
<a>‘s are clicked:But you can trigger events in jQuery. Like so: