触摸设备是否可以在不抬起手指的情况下单击按钮? 几乎像刷钢琴一样。我正在使用它作为触摸设备的无线游戏手柄。
可以在javascript或Jquery中使用吗?
我现在有了这个代码。
https://jsfiddle.net/11fz6nen/
<html>
<head>
<script type="text/javascript" src="//code.jquery.com/jquery-2.2.2.js"></script>
<link rel="stylesheet" type="text/css" href="/css/result-light.css">
<style type="text/css">
.button {
width: 100px;
height: 100px;
}
</style>
<title>Click button Touch</title>
<script type='text/javascript'>
//<![CDATA[
window.onload = function() {
$(document).ready(function() {
$('#button1').click(function() {
$('body').css("background-color", "red");
});
$('#button2').click(function() {
$('body').css("background-color", "green");
});
$('#button3').click(function() {
$('body').css("background-color", "blue");
});
$('#button4').click(function() {
$('body').css("background-color", "orange");
});
$('#button5').click(function() {
$('body').css("background-color", "pink");
});
$('#button6').click(function() {
$('body').css("background-color", "purple");
});
});
}
//]]>
</script>
</head>
<body>
<button class="button" id="button1">test1</button>
<button class="button" id="button2">test2</button>
<button class="button" id="button3">test3</button>
<button class="button" id="button4">test4</button>
<button class="button" id="button5">test5</button>
<button class="button" id="button6">test6</button>
</body>
</html>