samuel
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by samuel
-
-
Hi,
I am searching for a way to alter css values that are set with tweenmax.
for example:
TweenMax.to(".obj",1,{marginLeft:400});
with jQuery i could do something like this:
$.cssHooks.marginLeft = {get: function( elem, computed, extra ) {return $.css( elem, "marginLeft");},set: function( elem, value) {elem.style["marginLeft"] = (parseFloat(value) * 0.5) + "px";}};The reason I want to do this is because I have a lot's of tweens and the animation should be adaptive. I could adjust them al by hand but it would be much easier if could add a ratio per breakingpoint.
csshook for tweenmax
in GSAP
Posted
Thanks, I'll have a look into creating a custom plugin. I'dont wan't to use percentages because of rounding issues. I use a lot of png sprite animations and when I use percentages things tend to cut off or add an extra pixel.