Difference between revisions of "Team:CHINA CD UESTC/Description"
Line 41: | Line 41: | ||
</style> | </style> | ||
− | + | <script type="text/javascript"> | |
+ | function myEvent(obj,ev,fn){ | ||
+ | if(obj.attachEvent){ | ||
+ | obj.attachEvent('on'+ev,fn); | ||
+ | }else{ | ||
+ | obj.addEventListener(ev,fn,false); | ||
+ | } | ||
+ | } | ||
+ | myEvent(window,'load',function(){ | ||
+ | var oRTT=document.getElementById('rtt'); | ||
+ | var pH=document.documentElement.clientHeight; | ||
+ | var timer=null; | ||
+ | var scrollTop; | ||
+ | window.onscroll=function(){ | ||
+ | scrollTop=document.documentElement.scrollTop||document.body.scrollTop; | ||
+ | if(scrollTop>=pH){ | ||
+ | oRTT.style.display='block'; | ||
+ | }else{ | ||
+ | oRTT.style.display='none'; | ||
+ | } | ||
+ | return scrollTop; | ||
+ | }; | ||
+ | oRTT.onclick=function(){ | ||
+ | clearInterval(timer); | ||
+ | timer=setInterval(function(){ | ||
+ | var now=scrollTop; | ||
+ | var speed=(0-now)/10; | ||
+ | speed=speed>0?Math.ceil(speed):Math.floor(speed); | ||
+ | if(scrollTop==0){ | ||
+ | clearInterval(timer); | ||
+ | } | ||
+ | document.documentElement.scrollTop=scrollTop+speed; | ||
+ | document.body.scrollTop=scrollTop+speed; | ||
+ | }, 30); | ||
+ | } | ||
+ | }); | ||
+ | </script> | ||
<body id="homeIndexBody"> | <body id="homeIndexBody"> | ||
<div id="RightSection"></div> | <div id="RightSection"></div> |
Revision as of 00:41, 16 September 2015
<!DOCTYPE html>
DESCRIPTION
Do you know how to solve energy crisis utilizing biological methods? Have you ever heard about constructing a cell with enzyme? Nothing is too strange in the nature. There are many special properties of bacteria in the nature such as producing electricity, being attracted by magnet.Please read the description!