Answer the question
In order to leave comments, you need to log in
What to do with a bug in Chrome?
When transforming an element, hover(+click event) sometimes works, sometimes it doesn't.
This example works when reloading the page or following a link to it.
Can't be caught in jsfiddle.
Here is an example of this code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
#test{
position: fixed;
top:0px;
left: 40%;
height: 150px;
width: 500px;
background-color: red;
-webkit-transform: translate3d(0,0,0);
transition: transform .4s ease-out;
}
#test:hover{
background: green;
}
</style>
</head>
<body>
<div id="test"></div>
<script>
window.onload = function(){
document.getElementById('test').style.webkitTransform = "translate3d(0px, 250px, 0px)";
}
</script>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Try adding pointer-events: auto
after the animation ends
<script>
window.onload = function(){
document.getElementById('test').style.webkitTransform = "translate3d(0px, 250px, 0px)";
setTimeout(function(){
document.getElementById('test').style.pointerEvents = "auto";
},400)
}
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question