2016-06-30 4 views
0

は、私は頭の動きでページをスクロールできるようにしたい処理します。イベントリスナーはheadtrackr.js</p>私は基本的なHTMLページにコードを実装している <p><a href="https://github.com/auduno/headtrackr" rel="nofollow">https://github.com/auduno/headtrackr</a></p> <p>を使用してheadtrackr.js

<html> 
<head> 
<title>Test</title> 
    <script src="headtrackr.js"></script> 

</head> 
<body> 
<canvas id="inputCanvas" width="320" height="240" style="display:none"></canvas> 
<video id="inputVideo" autoplay loop></video> 
<script type="text/javascript"> 
    var videoInput = document.getElementById('inputVideo'); 
    var canvasInput = document.getElementById('inputCanvas'); 
    var htracker = new headtrackr.Tracker(); 
    htracker.init(videoInput, canvasInput); 
    htracker.start(); 
</script> 
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p> 
</body> 
</html> 

上記はSSL対応です。動画が表示されます。顔が検出されます。しかし、文書はスクロールしません。

私は別のものが必要ですか?リスナーのようにヘッドトラックの読み取り値を読み取るように? githubのドキュメントやhttp://www.digitoffee.com/video/scroll-a-document-by-just-moving-your-head/428/

答えて

1

のように、このイベントリスナーを追加して、何をしたいのですか?

document.addEventListener('headtrackingEvent', function(e) { 
window.scrollTo(e.x, e.y); 
} 
関連する問題

 関連する問題