Returns the Top effect based on jQuery.

Source: Internet
Author: User
Tip: you can modify some code before running

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Returns the Top effect based on jQuery.</title></head><body><style type="text/css">/* Return to the top */# roll_top {position: relative; margin-bottom: 1px; cursor: pointer; height: 60px; width: 60px; display: block; background: # ddd ;}# roll_top: hover {background: #666 ;}# roll {width: 60px; position: fixed; right: 30px; bottom: 50px; _ position: absolute; _ margin-top: 300px; _ bottom: auto; _ top: expression(eval(document.documentelement.scrolltop#document.doc umentElement. clientHeight-40-this.offsetHeight-(parseInt (this. currentStyle. marginTop, 10) | 0)-(parseInt (this. currentStyle. marginBottom, 10) | 0 )));}</style><p align="right">1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br />1111<br /></p><div id="roll"> </i> </div><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script><script type="text/javascript">JQuery (function () {/* return to the top and contact customer service */var jq = jQuery; jq ('# roll_top '). hide (); jq (window ). scroll (function () {if (jq (window ). scrollTop ()> 0) {jq ('# roll_top '). fadeIn (400); // The time when the slider slides down.} else {jq ('# roll_top '). fadeOut (200); // The time when the button fades back to the first screen on the top}); jq ('# roll_top '). click (function () {jq ('HTML, body '). animate ({scrollTop: '0px '}, 200); // return the time used at the top });});</script></body></html></td> </tr></table>
Tip: you can modify some code before running

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.