Jquery scrollUp scroll to the top

Source: Internet
Author: User

Jquery scrollUp scroll to the top

Preface: When a page is scrolled to a very low place, if there is a shortcut button to make it scroll to the top of the page, it is naturally required by the user, andJquery scrollUpThis plug-in meets our needs. However, it is obviously ineffective to read articles such as jQuery rolling to the top plug-in scrollUp, and additional settings are required.

In addition, I want to talk about jfinal in my jfinal series. However, as the project progresses, I find that the title cannot meet my needs, I want to talk about "explore jfinal and bootstrap", but the column cannot be changed, so I have to endure it.

Material Preparation

You can select my resource library to download it or download it from the official website. You need to make some modifications as provided by the official website.

Font awesome scrollup tutorial

Import File

  
<script type=text/javascript src=${ctx}/components/scrollup/jquery.scrollUp.min.js></script> 

If there are other items, You can import them on your own!

Js

// Enable scroll up $ (function () {$. scrollUp ({scrollName: scrollUp, topDistance: 300, topSpeed: 300, animation: fade, animationInSpeed: 200, animationOutSpeed: 200, scrollText: '', activeOverlay :! 1 });});

The Style "fa-angle-up" in font awesome is used here ".

Parameter description

Parameter Name Description
ScrollName Binding id. The default value is scrollUp.
TopDistance When the distance between the scroll bar and the top is pixel, the default value is 300
TopSpeed Time to scroll to the top, in MS, 300 by default
Animation Options include fade (fade-in and fade-out), slide (slider), and none (none)
AnimationInSpeed Time when the button appears
AnimationOutSpeed Time when the button is hidden
ScrollText Text in the button. The default value is Scroll to top.
ActiveOverlay Whether to display reference lines. The value is a hexadecimal color value or false. The default value is false.

I have adjusted the parameters for a while, but the effect is not very good. This still needs to be explored.

CSS

#scrollUp {    background-color: #777;    border: medium none;    bottom: 100px;    color: #eee;    font-size: 40px;    height: 46px;    line-height: 1;    opacity: 0.8;    overflow: hidden;    right: 20px;    text-align: center;    text-decoration: none;    width: 46px;}#scrollUp:hover {    background-color: #333;}

Custom style.

I have modeled the effect of bootstrap's Chinese network.

 

Related Article

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.