Jump to content
Search Community

MaryJoS

Members
  • Posts

    2
  • Joined

  • Last visited

MaryJoS's Achievements

0

Reputation

  1. I've tried fromTo and set to start the autoAlpha to 0. It works on the first time the timeline runs, but the play after a restart().pause() sets the divs' visibility to visible. See code below to initialize the timeline. var timeline = new TimelineLite({ paused: true,delay:0.5 }); timeline.duration(jQuery("#audioplayer").data("jPlayer").duration); jQuery.each(divAF.data('json'), function (index, value) { var o = jQuery('#' + value.id); var beginningState = { autoAlpha: 0 }; if ((value.timeIn == "-1" || value.timeIn == "0") && (value.animateIn == -1)) { beginningState["autoAlpha"] = 1; } if ((value.x != '-1') || (value.y != '-1')) { var x = (value.x != '-1') ? parseInt(value.x) : 0; var y = (value.y != '-1') ? parseInt(value.y) : 0; beginningState["position"] = "absolute"; beginningState["left"] = x; beginningState["top"] = y; } else { beginningState["position"] = "relative"; } if (value.z != '-1') { beginningState["z-index"] = parseInt(value.z); } if (value.width != '-1') { beginningState["width"] = parseInt(value.width); } if (value.height != '-1') { beginningState["height"] = parseInt(value.height); } timeline.add(TweenLite.set(o, beginningState)); if (value.animateIn != -1 && value.timeIn != "-1") { timeline.add(TweenLite.to(o, 1, { autoAlpha: 1 }), parseInt(value.timeIn)+1); } if (value.animateOut != -1 && value.timeOut != "-1") { timeline.add(TweenLite.to(o, 1, { autoAlpha: 0 }), parseInt(value.timeOut)+1); } });
  2. How should one restart but not play when the initial objects are all set to visibility is hidden? When my timeline plays the first round, the initial visibility (set in css class) for my divs start hidden. A few seconds in they fade in with autoAlpha and then few seconds later fade out with autoAlpha. At the end of the timeline, the timeline is reset. When I click a button to play again, the divs are visible intitially... How should the divs be set in the first place?
×
×
  • Create New...