javascript - 当开发者控制台在 chrome 中打开时,为什么 onmouseover 停止工作?

标签 javascript html macos google-chrome

当开发者控制台在 chrome 中打开时,为什么 onmouseover 停止工作? 相反,它会触发 onclick。

考虑这个简单的例子。当控制台关闭时,它会在鼠标悬停时调整图像大小,但仅在控制台打开时单击时调整图像大小

<!DOCTYPE html>
<html>
<head>
<script>
    function over(x) { x.style.height="64px"; }
    function out(x) {  x.style.height="32px"; }
</script>
</head>
<body>
    <img onmouseover="over(this)" onmouseout="out(this)" src="animage.png" />
</body>
</html>

最佳答案

您使用的是哪个版本的 Google Chrome 浏览器?
对我来说,它没有任何问题:http://jsfiddle.net/MXTQJ/

<script>
function over(x) { x.style.height="64px"; }
function out(x) {  x.style.height="32px"; }
</script>
<img onmouseover="over(this)" onmouseout="out(this)" src="animage.png" />

关于javascript - 当开发者控制台在 chrome 中打开时,为什么 onmouseover 停止工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16747929/

相关文章:

macos - osx 10.9.5 代码签名 V2 - 使用 : bundle format is ambiguous 签署框架

javascript - 如何一次选择多个复选框?

javascript - jquery/js 中添加按钮时出错

css - 在外部 DIV 上隐藏固定位置 DIV 的 Overflow-x

ios - Podspec 验证错误 - 文件模式 : The spec is empty

javascript - 为什么 Javascript 不允许我关闭函数?

JavaScript 正则表达式测试和替换

javascript - 如何激活 jQuery Accordion 菜单?

javascript - 在 Jquery 多步骤表单中刷新 Google map

git - 无法使用 ssh 进行 git 克隆、推送、 pull ,引发 kex_exchange_identification 错误