Only change two place:
, the return speed - >Changed to slowly back. (turns out to be a flash and return)
, the timing of returns at the top of the icon appears >Changed to just isn't in at the top of the display. (the original scroll down to show after 500 px)

note: JS, be sure to write after Html;
HTML
code is as follows:


<Div id="d - the top" style="display: none;" >
<A id="d - top - a" href="http://www.script-home.com//html5/#" title="return to top" >
<Img SRC="http://static.blog.csdn.net/images/top.png" Alt="TOP"/></a>
</div>

Javascript
code is as follows:


<The script type="text/javascript" >
$(function () {
var d_top=$(' # d - top);
the document. The onscroll=function () {
var scrTop=(document. The body. The scrollTop | | document. The documentElement. The scrollTop).
the if (scrTop> 500) {
the if (scrTop> 0) {
d_top. The show ();
} else {
d_top. Hide ();
}
}
$(' # d - top - a '). The click (function () {
$(" HTML, body "). The animate ({scrollTop: 0}, 500).
//scrollTo (0, 0);
this. The blur ();
return false.
});
});
</script>

CSS

  code is as follows:  


# d - top {
position: fixed;
float: right;
z - index: 10;
right: 10 px;
bottom: 40 px;

} # d - top img {
width: 42 px;
opacity: 0.3;

} img {
border: medium none;
}


This concludes the body part