Steynsk
asked on
mousedown and mouseup for touch screen?
Hi Experts,
Yesterday Tom Beck helped me out with this script what does what should do on a regular PC.
But would it be possible to make this work on a touch screen?
Yesterday Tom Beck helped me out with this script what does what should do on a regular PC.
But would it be possible to make this work on a touch screen?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo</title>
<script type='text/javascript' src='//code.jquery.com/jquery-2.1.3.js'></script>
<link rel="stylesheet" type="text/css" href="/css/result-light.css">
<script type='text/javascript'>
//<![CDATA[
$(function(){
$('#Clicker').mousedown(function () {
var txt = '*';
$('#output').text(txt);
timeout = setInterval(function () {
txt += '*';
$('#output').text(txt);
}, 100);
return false;
});
$('#Clicker').mouseup(function () {
clearInterval(timeout);
$('#output').text('');
return false;
});
$('#Clicker').mouseout(function () {
clearInterval(timeout);
$('#output').text('');
return false;
});
});//]]>
</script>
</head>
<body>
<button id="Clicker">Push</button>
<p id="output"></p>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dear Tom,
Again absolutely fabulous!
Thanks a lot,
Steynsk
Again absolutely fabulous!
Thanks a lot,
Steynsk
You're welcome. Thanks for the points.
Rely mostly only on the mouseup event, put your important actions there.