In my aspx file, I use jQuery tabs and I need to change these tabs by pressing ctrl + tab, but as you know this combined key has been used for ch开发者_StackOverflow社区anging browser tabs and I need to make that disable and instead of that change these jQuery tabs.
Prevent the default action using:
$(window).keydown(function(e) {
e.preventDefault(); // this should stop any default behavior
// switch tab function
});
As you can see here in SO, pressing Ctrl B makes the text bold (on Firefox it should open bookmark window, but they override
this behavior).
No, you cannot prevent Ctrl+Tab doing its default action, in Firefox at least. When Ctrl+Tab is pressed (in contrast to the vast majority of other key combinations), no event is fired on the window, so you can neither prevent it nor respond to it.
精彩评论