source: tmcsimulator/trunk/webapps/cptms/scrolldemo.html @ 348

Revision 348, 1.2 KB checked in by jdalbey, 7 years ago (diff)

Added gotoxmltime.html and other prototypes for ei notebook. They can be removed when no longer needed.

Line 
1<html>
2<head>
3<style>
4.pic-container {
5    width: 500px;
6    height: 400px;
7    overflow-y: scroll;
8    overflow-x:hidden;
9}
10</style>
11<body>
12<div id="one">Header</div>
13<div id="container">
14    <div id="main" class="pic-container"></div>
15</div>
16<div id="two">Footer</div>
17<script   src="poem.js"></script>
18<script>
19function adjust()
20{
21    currLine += 2;
22    if (currElement != null)
23    {
24        currElement.style.background = "GhostWhite";
25        currElement = document.getElementById(currLine)
26        //currElement.scrollTop = 0;
27        currElement.scrollIntoView(); 
28        currElement.style.background = "Gold";
29    }
30    if (currLine >=99) currLine = 1
31}
32
33var fields = poem.split('\n');
34for (item in fields)
35{
36    var div = document.createElement("div");
37    div.id=item
38    div.style.color = "black";
39    if (item % 2 == 0)
40    {
41        div.style.background = "Gainsboro ";
42    }
43    else
44    {
45        div.style.background = "GhostWhite";
46    }
47    div.innerHTML = fields[item];
48
49    document.getElementById("main").appendChild(div);
50}
51var currLine = 1;
52var currElement = document.getElementById("1");
53myVar = setInterval(adjust, 1000);
54//clearTimeout(myVar);
55//document.getElementById("9").scrollIntoView();
56</script>
57</body>
58
59</html>
Note: See TracBrowser for help on using the repository browser.