Difference between revisions of "Template:NYU Shanghai"

Line 178: Line 178:
 
<script type="text/javascript">
 
<script type="text/javascript">
 
document.onscroll=function(){
 
document.onscroll=function(){
var s = document.scrollLeft;
 
 
//document.getElementById("nav").scrollLeft = document.getElementById("content").scrollLeft;
 
//document.getElementById("nav").scrollLeft = document.getElementById("content").scrollLeft;
 
                 document.getElementById("testdiv").style.backgroundColor = "blue";
 
                 document.getElementById("testdiv").style.backgroundColor = "blue";
                 document.getElementById("testdivP").innerHTML = String(s);
+
                 document.getElementById("testdivP1").innerHTML = document.body.scrollLeft;
 +
                document.getElementById("testdivP2").innerHTML = String(document.body.scrollLeft);
 
};
 
};
 
   function reset() {
 
   function reset() {
Line 359: Line 359:
 
</div>
 
</div>
 
<div style="width: 982px; height: 80px;"></div>
 
<div style="width: 982px; height: 80px;"></div>
<div id="testdiv" style="height: 100px; width: 100px; background-color: lime; margin: 0 auto;"><p id="testdivP"></p></div>
+
<div id="testdiv" style="height: 100px; width: 100px; background-color: lime; margin: 0 auto;"><p id="testdivP1"></p><p id="testdivP2"></p></div>
 
</body>
 
</body>
 
</html>
 
</html>

Revision as of 03:35, 25 August 2015