git @ Cat's Eye Technologies yoob.js / a4f1bdf
Controller allows speed to be adjusted. catseye 12 years ago
2 changed file(s) with 12 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
1515 <button id="stop">Stop</button>
1616 <button id="step">Step</button>
1717 <button id="load">Load</button>
18 Speed: <input id="speed" type="range" min="0" max="200" value="0" />
1819
1920 </body>
2021 <script>
3536 'stop': 'stop',
3637 'step': 'step',
3738 'load': 'load',
38 'source': 'input'
39 'source': 'input',
40 'speed': 'speed'
3941 });
4042 </script>
3333 * with those ids will be obtained from the document and used.
3434 */
3535 this.connect = function(dict) {
36 var self = this;
3637 var keys = ["start", "stop", "step", "load"];
3738 for (var i in keys) {
3839 var key = keys[i];
5960 }
6061 if (speed !== undefined) {
6162 this.speed = speed;
63 speed.value = self.delay;
64 speed.onchange = function(e) {
65 self.delay = speed.value;
66 if (self.intervalId !== undefined) {
67 self.stop();
68 self.start();
69 }
70 }
6271 }
6372 };
6473