GreenSock Docs (HTML5/JS)


Included in TweenMax: YES

RoundProps ensures that the property values always get rounded to the nearest integer during the tween. Just pass in a comma-delimited list of property names that should be rounded. For example, if you're tweening the x, y, and opacity properties of "#someID" element and you want to round the x and y values (not opacity) every time the tween is rendered, you'd do:, 2, {x:300, y:200, opacity:0.5, roundProps:"x,y"});

Note: as of GSAP 1.19.0, RoundPropsPlugin leverages the same plumbing internally as ModifiersPlugin (roundProps is just a modifier that applies Math.round()), thus you cannot do BOTH a modifier and roundProps on the same property in the same tween. It's easy to get that functionality, though, by just doing Math.round() inside your modifier function.

Copyright 2017, GreenSock. All rights reserved. This work is subject to theterms of useor for Club GreenSock members, the software agreement that was issued with the membership.


Version: 1.20.4 updated 2018-02-15




        By using GreenSock code, you agree to the terms of use.

        Help support GreenSock by becoming a member

        Join Club GreenSock