Team:SYSU-Software/menu
From 2012.igem.org
(Difference between revisions)
Nie1234567 (Talk | contribs) |
Nie1234567 (Talk | contribs) |
||
(5 intermediate revisions not shown) | |||
Line 53: | Line 53: | ||
display: block; | display: block; | ||
} | } | ||
- | + | #goTopBtn { | |
+ | POSITION: fixed; TEXT-ALIGN: center; LINE-HEIGHT: 30px; WIDTH: 30px; BOTTOM: 35px; HEIGHT: 33px; FONT-SIZE: 12px; CURSOR: pointer; RIGHT: 0px; _position: absolute; _right: auto | ||
+ | } | ||
</style> | </style> | ||
+ | <SCRIPT type=text/javascript > | ||
+ | |||
+ | function goTopEx(){ | ||
+ | var obj=document.getElementById("goTopBtn"); | ||
+ | function getScrollTop(){ | ||
+ | return document.documentElement.scrollTop; | ||
+ | } | ||
+ | function setScrollTop(value){ | ||
+ | document.documentElement.scrollTop=value; | ||
+ | } | ||
+ | window.onscroll=function(){getScrollTop()>0?obj.style.display="":obj.style.display="none";} | ||
+ | obj.onclick=function(){ | ||
+ | var goTop=setInterval(scrollMove,10); | ||
+ | function scrollMove(){ | ||
+ | setScrollTop(getScrollTop()/1.1); | ||
+ | if(getScrollTop()<1)clearInterval(goTop); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | </SCRIPT> | ||
+ | <body > | ||
+ | |||
+ | <DIV style="DISPLAY: none" id=goTopBtn><img border=0 src="http://preview.zcool.com.cn/upimg/allimg/070622/0304268.gif" style="width: 25px;"/></DIV> | ||
+ | <SCRIPT type=text/javascript>goTopEx();</SCRIPT> | ||
+ | |||
+ | </body> | ||
</html> | </html> |
Latest revision as of 01:37, 27 September 2012
![](http://preview.zcool.com.cn/upimg/allimg/070622/0304268.gif)