OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <head> | |
3 <script type="text/javascript" src="resources/reveal-utilities.js"></script> | |
4 </head> | |
5 <body> | |
6 <div>When the caret is scrolled out, on starting typing it must be brought to th
e center of the control.</div> | |
7 <span style="position:absolute; visibility:hidden" id="single-digit">0</span> | |
8 <div style="border:thin solid black; overflow:scroll" contenteditable="true" id=
"input-contenteditable"></div> | |
9 <script> | |
10 | |
11 var contentEditable = document.getElementById("input-contenteditable"); | |
12 contentEditable.innerHTML = generateNumbers(0, 30, 2, "<br>"); | |
13 var singleDigitHeight = document.getElementById("single-digit").clientHeight; | |
14 var contentEditableSize = 10; | |
15 contentEditable.style.height = (singleDigitHeight * contentEditableSize) + "px"; | |
16 contentEditable.focus(); | |
17 var child = contentEditable.firstChild; | |
18 for (var i = 0; i < 36; ++i) | |
19 child = child.nextSibling; | |
20 getSelection().collapse(child, 0); | |
21 if (window.eventSender) | |
22 eventSender.keyDown(">"); | |
23 | |
24 </script> | |
25 </body> | |
OLD | NEW |