Answer the question
In order to leave comments, you need to log in
Chrome hover bug?
Some fool has taken over chrome...
When hovering over a hover element or a click handler, it fires every other time. As I noticed, this applies to elements whose position we twisted using JS. For example, transformation.
Obviously chrome doesn't stupidly redraw the internal representation of the DOM.
If you scroll a little with the mouse on the desired element, click somewhere nearby, call hover on another static element. That all fades away.
PS It is clear that this is a bug. Just before making sure that this is a bug, I had to shovel the layout. Sighing with sadness and relief. I decided to share it with the toaster :)
PS You can catch a bug on jsfiddle, but it's more difficult. Therefore, I will give just HTML code.
To make it work here, you need to load this page and press F5.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
#test{
position: fixed;
transform: translate3d(0,0,0);
transform: scale(0.1);
width: 70%;
margin: auto;
height: 30%;
background: blue;
cursor: pointer;
transition: transform .4s ease-out;
}
#test:hover{
background: green;
}
</style>
</head>
<body>
<div id="test"></div>
<script>
setTimeout(function(){
document.getElementById('test').style.transform = "translate3d(0,40px,0)";
document.getElementById('test').style.transform = "scale(0.5)";
},100)
</script>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question