i have the options of my web application in tabs.
Unfortunately, event.metaKey
does not evaluate to true on Windows when the ctrl key is held on click.
Fortunately, event.ctrlKey
does evaluate to true in these situations. Also, you may want to consider shift + clicks in your event handler.
Thus, your cross platform jquery flavored javascript code would look something like:
$('ul#tabs li a').on('click', function(e) {
var link = $(this).attr('href');
// Check "open in new window/tab" key modifiers
if (e.shiftKey || e.ctrlKey || e.metaKey) {
window.open(link, '_blank');
} else {
$('#content').fadeOut('fast',function(){
window.location = link;
});
}
}
});