Template:SUSTC A1

From 2012.igem.org

(Difference between revisions)
Line 9: Line 9:
<style type="text/css">
<style type="text/css">
-
 
+
#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
 +
}
<!--我们需要先把igem原网站的一些东西删掉-->
<!--我们需要先把igem原网站的一些东西删掉-->
Line 151: Line 153:
body {
body {
 +
HEIGHT: 3600px;
margin: 0;
margin: 0;
padding: 0;
padding: 0;
Line 478: Line 481:
-
 
+
<SCRIPT type=text/javascript>
 +
// JavaScript Document
 +
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>
</style>
</style>

Revision as of 18:44, 20 September 2012