开发者

Can I use ctrl+ tab as a short key in my aspx file

开发者 https://www.devze.com 2023-01-19 21:04 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消