HTML study note 2 (Back to Top and back to bottom), study note back to top
Back to Top back to bottom
Two methods to return to the topI. Use js
$ ('Html, body '). animate ({scrollTop: 0}, 'save'); // $ ('html, body') with animation '). scrollTop (0)
Back to the top back to the exact partBack to the top of the two waysfirst, the use of JS$ (' HTML, Body '). Animate ({scrolltop:0}, ' fast ');//Drive Draw $ (' html,body '). scrolltop (0);//Without animation $ (window). Scroll (function () {
Back to the top back to the bottomBack to the top of the two waysfirst, the use of JS$ (' HTML, Body '). Animate ({scrolltop:0}, ' fast ');//Drive Draw $ (' html,body '). scrolltop (0);//Without animation $ (window). Scroll (function () {
Back to the top of the bottom
Two ways to get back to the topfirst, the use of JS
$ (' HTML, Body '). Animate ({scrolltop:0}, ' fast ');//Drive Draw
$ (' html,body '). scrolltop (0);//Without animation
$ (window). Scroll (function () {
On some sites, we often see the effect of returning to the top, and this article gives you an introduction to how to achieve the top effect based on jquery. Interested friends follow the small knitting together to see the implementation code bar.
Jquery.scrolltotop.js file
The code is as follows
Copy Code
/*** Escrolltotop jquery back to top plugin, smoothing back to top,** Parameter settings* Startline: To return the top button from the top of the distance*
Turn from: http://www.mojidong.com/html/css/js/2013/03/03/page-top-to-achieve/
Now many pages have a back to the top of the function, when you drag the scroll down to a certain extent will be in the lower right side of a back to the top of the
AngularJS command encapsulation Back to Top example details, angularjs Back to Top
For more information about how angularJS returns to the top, click code!
1. Build commands,Use registerDirective to build commands and add them to the internal
The back-to-top component is an extremely common web page function with simple requirements: After a page is rolled for a certain distance, the button on the back-to-top is displayed, click this button to roll back the scroll bar to the starting
The back-to-top component is an extremely common web page function with simple requirements: After a page is rolled for a certain distance, the button on the back-to-top is displayed, click this button to roll back the scroll bar to the starting
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.