Animated effects of Tween.js

Source: Internet
Author: User

Third party animation Tween.js

Used to achieve easing effects

Easing function query address: https://easings.net/zh-cn#

CDN Reference: Https://cdnjs.cloudflare.com/ajax/libs/tween.js/16.3.5/Tween.min.js

Reference Link: http://www.htmleaf.com/jQuery/Layout-Interface/201501271284.html

Easing function:

1 . Linear Uniform 2 . Quad two-time side easing effect 3. Cubic three-time side easing effect 4. Quart four-time side easing effect 5. Quint five-time side easing effect 6. Sine  sinusoidal easing effect 7. Expo  Index easing effect 8. CIRC  Circular easing function 9. Elastic exponential attenuation sine curve easing function ten. Back  over the range of the three-square easing function one at a time .  The easing function of rebound curve of Bounce exponential attenuation

Each easing function is made up of three effects:

1.easeIn  Acceleration 2.easeOut deceleration 3.easeInOut  first acceleration after deceleration

  

code example: Click on the navigation bar to jump to the corresponding position, where the easing code

function Animate (time) {requestanimationframe (animate);        Tween.update (time);                } requestanimationframe (animate); varcoords = {Y:currenttop};//Initial value        varT=math.abs ((s/ -)* -)        if(t> +) {T= -        }        varTween =NewTWEEN. Tween (coords) to ({y:targettop}, T)//target value-time. Easing (TWEEN. Easing.Quadratic.InOut)//slow animation, effect name, ease effect. OnUpdate (function () {Window.scrollto (0, Coords.y)})//The tween is executed after each update. Start (); }

Animated effects of Tween.js

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.