Debian Codegraph @

experiments/capture.html

raw
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3
4 <html lang="en">
5 <head>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7 <meta name="author" content="Fabian Jakobs">
8 <!-- Date: 2010-04-07 -->
9
10 <style type="text/css" media="screen">
11 #juhu {
12 width: 100px;
13 height: 50px;
14 background: yellow;
15 }
16 </style>
17 </head>
18 <body>
19
20 <div id="juhu">
21
22 </div>
23
24 <script src="../src/ace.js" type="text/javascript" charset="utf-8"></script>
25 <script type="text/javascript" charset="utf-8">
26
27 var el = document.getElementById("juhu");
28
29 ace.addListener(el, "mousedown", function(e) {
30 el.innerHTML = ace.getDocumentX(e) + " " + ace.getDocumentY(e);
31 ace.capture(
32 el,
33 function(e) {
34 el.innerHTML = ace.getDocumentX(e) + " " + ace.getDocumentY(e);
35 }, function() {
36 el.innerHTML = "";
37 }
38 );
39 });
40
41
42
43 </script>
44 </body>
45 </html>