ため
node.ontouchmove = function(e){
if(e.touches.length == 1){ // Only deal with one finger
var touch = e.touches[0]; // Get the information for finger #1
var node = touch.target; // Find the node the drag started from
node.style.position = "absolute";
node.style.left = touch.pageX + "px";
node.style.top = touch.pageY + "px";
}
}
または
document.addEventListener('touchstart', function(event) {
alert(event.touches.length);
}, false);
私はもMouseEventをキャプチャすると位置を表示するには、次のHTMLとJavaScriptを使用しましたWebView
のマウスクリックの
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript">
function SetValues()
{
var s = 'X=' + window.event.clientX + ' Y=' + window.event.clientY ;
document.getElementById('divCoord').innerText = s;
}
</script>
</head>
<body id="bodyTag" onclick=SetValues()>
<div id="divCoord"></div>
</body>
</html>
出典
2012-05-19 06:32:13
Ram
コロナゾロ:iPhoneではありません。同じココアのヒントはありますか? – Ram
Cocoa Touchは、Apple Inc.のiPhone、iPod Touch、およびiPad上で動作するソフトウェアプログラムを構築するためのUIフレームワークです。したがって、これはiPhoneの一部でもあります。 –
彼はmac os xを求めています。 – vikingosegundo