I've got a Jquery function:
$('#element').click(function(){..........});
Is there a way to check in this function whether it was triggered by real mouse or just by script $('#element').click();
?
Thanks for answers.
I've got a Jquery function:
$('#element').click(function(){..........});
Is there a way to check in this function whether it was triggered by real mouse or just by script $('#element').click();
?
Thanks for answers.
I think you can check e.originalEvent:
$('#element').click(function(e){
if (e.originalEvent !== undefined)
{
alert ('Mouse clicked');
}
else
{
alert( 'triggered programmatically' );
}
});