Jump to content
Search Community

Search the Community

Showing results for tags 'decimal'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Personal Website


Twitter


CodePen


Company Website


Location


Interests

Found 2 results

  1. Hey! I recently switched from Tween.JS to GSAP, and I'm trying to tween a number with potentially large number of decimal places. I wrote a small library that finds-on-screen and auto-tweens those numbers, so I do not have a *predefined* number of decimals - but as they're cryptocurrency prices, those can be 4, 6, 8 or 9 - usually. I noticed that both TweenMax and TweenLite do only 4 decimals, which is quite weird. Looking around the web (and this forum) I cannot find a solution/parameter/switch how to alter this behavior. Any advice? import gsap from 'gsap'; import { TweenLite, Expo } from 'gsap/all'; gsap.registerPlugin(Expo); export default class TweenEmAll { // ..cut objTween = undefined; objTweenProgress = { value: 0.000001 }; // experiment with pre-defined 6 decimals // ..cut tween() { // ..cut // launch new tween this.objTween = TweenLite.to(this.objTweenProgress, this.duration, { value: this.target, ease: Expo.easeOut, //decimals: 6, // experiment //autoRound: false, // experiment onUpdate: this.onTweenUpdate.bind(this) }); } onTweenUpdate() { // reconstruct value nicely let value = this.objTweenProgress.value.toFixed(6); // experiment // update appropriate element if(this.isInput) this.elmContainer.val(value); else this.elmContainer.html(value); } }
  2. Hello! I need to Tween a number from 0 to 53,5. Is this possible with GSAP? I-m trying and i'm having problems to count decimal numbers. var obj5 = {value:0}, element5 = document.getElementById("cantidadMujeres"); TweenMax.to(obj5, 1.4, {value:"53,5", ease:Linear.easeNone, onUpdate:function() { element5.innerHTML = obj5.value;}}); This is my code, the problem is that the counting number has like ten or eleven digits when init. And, if i add "roundProps:"value" " the decimal digit dont count. The is some solution to this? Thanks
×
×
  • Create New...