<div id="AdLayer" style=" position:absolute; width:16px; display:none; right:30px; border:1px solid #313; padding:4px;">
<a href=# style="width:16px; text-decoration:none; ">回到顶部</a>
</div>
<h1>a</h1>
<h1>a</h1>
<h1>a</h1>
<h1>a</h1>
<h1>a</h1>
<h1>a</h1>
...
..
.
<script type=text/javascript>
var n = 450;
var gotop=document.getElementById("top");
if(!gotop) {
return false;
}
var x = 0;
window.onscroll = function() {
gotop.style.top = (document.body.scrollTop || document.documentElement.scrollTop) + n + 'px';
x = (document.body.scrollTop || document.documentElement.scrollTop) + n;
if(x == 450){
gotop.style.display = 'none';
} else {
gotop.style.display = '';
}
};
window.onresize = function() {
gotop.style.top = (document.body.scrollTop || document.documentElement.scrollTop) + n +'px'
};
</script>