Home > Web Front-end > JS Tutorial > body text

Use jQuery to implement return to top_jquery

WBOY
Release: 2016-05-16 16:18:05
Original
1271 people have browsed it

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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!