I want to use fade effect with touch events in Chrome but touch events blocking.
In this fiddle there is simple code to fade in for touchstart and fade out for touchend events. When your touch starts everything is ok. You can remove your finger and touch again in 1 seconds and you can see fade in-out. But when time is reachs exactly 1 second then opacity reachs 0 and touchevents are blocked.
Is this a bug or coding problem?
Thanks,
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
.border {
border:1px solid red;
height: 300px;
}
.visible {
opacity: 1;
transition: opacity 1s linear;
}
.hidden {
opacity: 0;
transition: opacity 1s linear;
}
</style>
<script type="text/javascript">
window.onload=function(){
var div = document.getElementsByName('div')[0];
div.addEventListener('touchstart', function (e) {
div.className = 'border visible';
});
div.addEventListener('touchend', function(e){
div.className = 'border hidden';
});
};
</script>
</head>
<body>
<div name="div" class="border visible"></div>
</body>
</html>