gpt4 book ai didi

javascript - Firefox 3.6 没有右键单击事件

转载 作者:搜寻专家 更新时间:2023-11-01 05:18:23 25 4
gpt4 key购买 nike

我正在将应用程序移植到 JavaScript/CSS,它使用右键单击。出于某种原因,适用于 Windows 的 Firefox 3.6 不会发出右键单击事件,但 Chrome 和 IE 会发出。这是一些测试代码。如果您右键单击 #test,那么您在 Firefox 中什么也得不到,但在 Chrome 和 IE 下您会收到警告。

<html>
<head>
<title>Hi</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$("#test").get(0).oncontextmenu = function() { return false; };
$("#test").mousedown(function() { alert("hi"); });
});
</script>
</head>
<body>
<div id="test" style="background: red;">Hi</div>
</body>
</html>

为什么在 Firefox 中不生成右键单击事件?

最佳答案

我发现了问题。我安装了“多合一手势”扩展。我尝试在禁用它的情况下运行代码并且它工作正常。看起来像是扩展的错误/限制。

更新:我刚刚尝试了“Mouse Gestures Redox”扩展,它没有这个问题。

关于javascript - Firefox 3.6 没有右键单击事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2444151/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com