Home >Web Front-end >JS Tutorial >Introduction to a simple elastic return to top JS code implementation_javascript skills

Introduction to a simple elastic return to top JS code implementation_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:32:301121browse

I made a function like this yesterday and posted it for reference.
HTML/JS/CSS code:

Copy code The code is as follows:





Flexible return to top JS code














When it exceeds the scope of the first screen, the TOP button will appear, otherwise it will be automatically hidden.






Rendering:
The page scroll bar is at the low end
1.
Introduction to a simple elastic return to top JS code implementation_javascript skills
2. Click to return to the top and hide it.
Introduction to a simple elastic return to top JS code implementation_javascript skills
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