Template:Team:Tsinghua-E/Template
From 2013.igem.org
(Difference between revisions)
Line 27: | Line 27: | ||
var PageScrollElem,PageScrollBody; | var PageScrollElem,PageScrollBody; | ||
var PageScrollHand=null; | var PageScrollHand=null; | ||
- | + | 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 34: | Line 56: | ||
PageScrollTotop(); | PageScrollTotop(); | ||
} | } | ||
- | |||
</script> | </script> | ||
- | |||
<!-- *** hiding the top section & changing the menubar/top ++piggy edit++ *** --> | <!-- *** hiding the top section & changing the menubar/top ++piggy edit++ *** --> |
Latest revision as of 18:43, 27 September 2013