Jump to content
Search Community

Nalex

Members
  • Posts

    4
  • Joined

  • Last visited

Nalex's Achievements

  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. It looks pretty good. Will try this, thank you!
  2. So, it was not very good idea, but i tried to cut the page to make working ranges:
  3. So, it was not very good idea, but i tried to cut the page to make working ranges:
  4. Hey. I started to use gsap animation few weeks ago and create some functions, but i dont know, how i could round values to prevent float values during animations. My code is working, but is very bad code, i think function prettify(num) { let n = num.toString(); return n.replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g, "$1" + ' '); } // transform digits like 99000 in digits 99 000 (adding spaces) const total_total = Math.round(((((type * ppl * days * hours) * ak) * tax) + total_cord) / 10) * 10; // my value TweenLite.to(total_result, 0.5, {innerHTML: prettify(total_total), roundProps: 'innerHTML', ease: SteppedEase.config(10), onComplete: function(){ $('#total_result').val(total_total)}}) } // my animation So, to round my values i need now: 1. round value in 10 like (/ 10) * 10) 2. i need to add Stteped ease with config 10 3. i need to add roundProps. Please help me How i can do it easily to prevent float digits during animation. Thank you.
×
×
  • Create New...