Jump to content
Search Community

seanmoo

Members
  • Posts

    2
  • Joined

  • Last visited

seanmoo's Achievements

2

Reputation

  1. i got it, thank you so much . my issue have resloved
  2. i want to set random backgroundcolor of the animate elements, but still not works, in the following code,i tried to test several properties "left"、"top" and "skewY" "backgroundColor",why "left" "top" is regular working, if set "backgroundColor" value to colors arrary ,it can regular working , but set to an anonymous funtion will not work. the "skewY" is same issue, it confused me , the anonymous funtion return a colors arrary too, why not work. var colors = ["#164","#350","#350","#088","#254","#401","#306","#209","#005","#987","#614","#767","#406","#909","#201","#405","#806","#558"]; var tween = new TimelineLite(); var obj = $(".dot-test"); tween.add(TweenMax.staggerFrom(obj, 2, { cycle: { skewY: ["42deg", "242deg", "12deg", "92deg", "256deg", "310deg", "48deg", "122deg", "162deg", "142deg", "77deg"], // backgroundColor : colors, backgroundColor:function(){ var m = new Array(); for (var i = 0; i < 80; i++) { m.push("#"+ Math.floor((Math.random() * 10))+ Math.floor((Math.random() * 10))+Math.floor((Math.random() * 10))); // to construct a color arrary. } console.info(m); return m; }, left: function () { var m = []; for (var i = 0; i < 80; i++) { m.push(Math.random() * 10000 * (Math.random() > 0.5 ? -1 : 1)); } return m; }, top: function () { var m = []; for (var i = 0; i < 80; i++) { m.push(Math.random() * 5000 * (Math.random() > 0.5 ? -1 : 1)); } return m; }, autoAlpha: [0], }, yoyo: true, ease: Power4.easeOut },0.1)); thanks for come in to see my iusse.
×
×
  • Create New...