Line 149: | Line 149: | ||
<img src="https://static.igem.org/mediawiki/2016/f/fa/T--SCAU-China--Home5.png" onClick="abc()" width="100px" /> | <img src="https://static.igem.org/mediawiki/2016/f/fa/T--SCAU-China--Home5.png" onClick="abc()" width="100px" /> | ||
</div> | </div> | ||
− | + | <script> | |
+ | var timer = null; | ||
+ | function abc(){ | ||
+ | cancelAnimationFrame(timer); | ||
+ | timer = requestAnimationFrame(function fn(){ | ||
+ | var oTop = document.body.scrollTop || document.documentElement.scrollTop; | ||
+ | if(oTop > 0){ | ||
+ | document.body.scrollTop = document.documentElement.scrollTop = oTop - 50; | ||
+ | timer = requestAnimationFrame(fn); | ||
+ | }else{ | ||
+ | cancelAnimationFrame(timer); | ||
+ | } | ||
+ | }); | ||
+ | } | ||
+ | </script> | ||
<script src="https://2016.igem.org/Team:SCAU-China/jsfile?action=raw&ctype=text/javascript"></script> <!--mater--> | <script src="https://2016.igem.org/Team:SCAU-China/jsfile?action=raw&ctype=text/javascript"></script> <!--mater--> | ||
</html> | </html> |
Revision as of 09:49, 17 October 2016