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

jQuery implements simple scrolling animation effect_jquery

WBOY
Release: 2016-05-16 15:06:21
Original
1782 people have browsed it

The idea of ​​animation is very simple. Click on an element on the page and the page will scroll to the specified position. Here is an introduction to the results of my 3 hours of research on Baidu:

First is the html part:

<html>
<body>
<a>顶部</a>
<a>中部</a>
...<p>持续添加直到出现滚动条</p>...
</body>
</html>
Copy after login

First add two elements as buttons. Then add the element:

<html>
<body>
<a href="javascript:;" id="tab1">顶部</a>
<a href="javascript:;" id="tab2">中部</a>
...<p>持续添加直到出现滚动条</p>...
</body>

Copy after login

href="javascript:;" probably means that the a element can activate js code. If not added, the code will be invalid. No need to add when using

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