This is the function I want to call (it definitely works I tested it):
function enableCategoryPopup(event) {
event.stopPropagation();
var buttonOffset = $(this).offset();
$('.category-popup').css({
top: buttonOffset.top + 10,
left: buttonOffset.left +10
});
$('.category-popup').show(100);
}
And this is where I want to call it:
$(document).on("mousedown", ".tab-links li:nth-child(2)", function(event) {
if (event.which == 3) {
enableCategoryPopup();
}
});
My custom function should be called as soon as I right click the specified element but it doesn't.
When I call alert("x") instead of enableCategoryPopup() it works, only my custom function doesn't get executed.
What am I doing wrong? How do I call my custom function?
eventobject to function,enableCategoryPopup(event);enableCategoryPopup(event);please :)".tab-links li:nth-child(2)", this delegated event won't be fired