在Google Chrome中停用Alt功能(快捷键) [英] Disable Alt functions (shortcuts) in Google Chrome

查看:641
本文介绍了在Google Chrome中停用Alt功能(快捷键)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码(作为快捷方式)在我的反馈页面上重定向用户。

 < a href =' / feedback /'accesskey ='f'>反馈< / a> 

但是这段代码在谷歌浏览器中不起作用,因为当用户按下 Alt + F < kbd>它会打开谷歌浏览器菜单栏。



如何禁用这些快捷方式?

它可以是jQuery,javascript ...



注意:我已经编写了一个重定向的JavaScript代码,但它首先打开Chrome菜单栏,然后​​执行其任务。如何在用户按下 Alt +其他按钮时禁用浏览器功能。 Javascript可以通过在函数返回false



的末尾写入来禁用此快捷键。示例

  function function1(){/ * code goes here * /;返回false} 


I use the following code (as shortcut) to redirect users on my feedback page.

<a href='/feedback/' accesskey='f'>feedback</a>

But this code does not work in Google Chrome because when user presses Alt + F it will open the Google Chrome menu bar.

How do I disable those 'shortcuts'?

It can be jQuery, javascript...

Note: I have written a javascript code that redirects, but it firstly opens the Chrome menu bar then does its job.

解决方案

I just found a way how to disable browser functions when user presses Alt + other button. Javascript can disable this shortcuts by writing at the end of the function return false

Example

function function1(){/* code goes here */; return false}

这篇关于在Google Chrome中停用Alt功能(快捷键)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆