Team:Tsinghua-E/Template
From 2013.igem.org
(Difference between revisions)
Line 44: | Line 44: | ||
<script> | <script> | ||
+ | function PageScrollTotop() | ||
+ | { | ||
+ | PageScrollElem = PageScrollElem * 0.7 - 0.5; | ||
+ | PageScrollBody = PageScrollBody * 0.7 - 0.5; | ||
+ | if (PageScrollElem<=0) | ||
+ | { | ||
+ | PageScrollElem=0; | ||
+ | } | ||
+ | if (PageScrollBody<=0) | ||
+ | { | ||
+ | PageScrollBody=0; | ||
+ | } | ||
+ | if (PageScrollElem<=0){ | ||
+ | if (PageScrollBody<=0){ | ||
+ | PageScrollHand = null; | ||
+ | }} | ||
+ | if (PageScrollBody>0 || PageScrollElem>0) | ||
+ | { | ||
+ | PageScrollHand = setTimeout(PageScrollTotop,50); | ||
+ | } | ||
+ | document.documentElement.scrollTop=PageScrollElem; | ||
+ | document.body.scrollTop=PageScrollBody; | ||
+ | } | ||
function NaviTotop() | function NaviTotop() | ||
{ | { | ||
Line 50: | Line 73: | ||
PageScrollTotop(); | PageScrollTotop(); | ||
} | } | ||
+ | |||
</script> | </script> | ||
Revision as of 18:05, 27 September 2013