Home  >  Article  >  Web Front-end  >  Use jQuery to implement return to top_jquery

Use jQuery to implement return to top_jquery

WBOY
WBOYOriginal
2016-05-16 16:18:051265browse

Using jQuery to implement. Pictures used:

1. Try scrolling this page to the bottom and the go2top button will appear.
2. go2top-inner is not used yet.
HTML&JS definition:

Copy code The code is as follows:



CSS Definition

Copy code The code is as follows:

.go2top {
background: url("http://images.cnitblog.com/blog/84698/201303/28125209-67653841b1114531a2a1e6db63315d63.png") no-repeat scroll left top transparent;
Bottom: 65px;
Color: #444444;
Display: none;
Height: 50px;
Margin-left: 510px;
position: fixed;
Right: 160px;
Text-align: center;
Width: 50px;
}
.go2top:hover {
Background-position: -50px top;
}

Try it and see if you can return to the top. It is a very convenient and practical function. I hope you will like it.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn