Difference between revisions of "Template:WHU-China"

Line 472: Line 472:
 
</script>
 
</script>
  
 +
 +
<script type="text/javascript">
 +
    $(function(){
 +
        $(window).scroll(function(){
 +
            var w_height = $(window).height();
 +
            var scroll_top = $(document).scrollTop();
 +
            if(scroll_top > w_height){
 +
                    $("#top_btn").fadeIn(500);
 +
                }else{
 +
                    $("#top_btn").fadeOut(500);
 +
            }
 +
        });
 +
    $("#top_btn").click(function(e){
 +
            e.preventDefault();
 +
            $(document.documentElement).animate({
 +
                scrollTop: 0
 +
                },200);
 +
            $(document.body).animate({
 +
                scrollTop: 0
 +
                },200);
 +
        });
 +
    })
 +
</script>
  
 
<style>
 
<style>
Line 485: Line 508:
 
     width:100%;
 
     width:100%;
 
   }
 
   }
 +
 +
        .top_btn{
 +
width:55px; 
 +
        height:55px; 
 +
        background:url(to-top.png); 
 +
        background-position:0px 0px; 
 +
        position:fixed; 
 +
        bottom:25px;
 +
right:25px;
 +
        color:white; 
 +
        z-index:20000; 
 +
        cursor:pointer; 
 +
}
 +
.top_btn:hover{ 
 +
        background:url(to-top-hover.png); 
 +
        }
 +
 +
 
   #topbanner-wrapper{
 
   #topbanner-wrapper{
 
    
 
    

Revision as of 11:33, 24 August 2017