当开发者控制台在 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/