jquery Plugin scrolltobyspeed Page Scrolling example

Source: Internet
Author: User


How to use

By introducing a plugin file into your Web page, you may also need to introduce jquery files because the plugin relies on the jquery library.

<script src= "Jquery.js" ></script>

<script src= "Scrolltobyspeed.jquery.js" ></script>

Now, when we want the window to scroll we give it the speed rather than the time.

$ (' #element '). Scrolltobyspeed ({

speed:1000

});

We can also add an offset to the scrolling position of the destination.

$ (' #element '). Scrolltobyspeed ({

speed:1000,

offset: -100

});

Sets the caching effect for the animation.

$ (' #element '). Scrolltobyspeed ({

easing: ' Linear '

});

The default scrolling context is the entire window. The scrolling of another scroll symbol specifies the context as a string of selectors or a jquery object.

$ (' #element '). Scrolltobyspeed ({context

: '. Foo '

});

If custom easing or callback is needed, use Plug-ins to get time and manual animations.

function () {

var $element = $ (' #element '),

duration = $element. Scrolltobyspeed ({mode: ' duration '});

...

}

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.