Google Maps API Mousemove on Touch Issue
Mousemove event is not triggering on Touch devices
by Abid Shaik
HTML
<script src="http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&.js"></script>
<button id="clear">
Clear Log
</button>
<div id="console">
Log goes here
</div>
<div id="TouchArea" style="height:600px">Hover on this<br>
<span id="SpanExp">Mouse Move event fires on desktops but when you user finger on touch devices "mouse move" won't fire. It workd only after enabling - -touch-event switch or enabling Touch Event API under chrome://flags/ </span>
</div>
CSS
#console {
height: 100px;
background-color: blue;
color: #fff;
margin-bottom: 10px;
overflow: auto;
}
#clear {
margin-bottom: 10px;
}
#TouchArea {
height: 600px;
background-color: red;
cursor: pointer;
font-size:40px;
}
#SpanExp{
color:white;
}
JavaScript
$(document).ready(function() {
$("#TouchArea").on("mousemove", function() {
$("#console").append(" Mouse Move ");
});
$("#clear").on("click", function() {
$("#console").html("Log goes here")
});
})