I have a page element that I’m using the SlideDown, SlideUp, and the PeriodicalExecuter to animate. Here’s the code:
<script type="text/javascript">
function scroll() {
new Effect.SlideUp(’scroller’, { duration: 6.0 });
new Effect.SlideDown(’scroller’, { queue: ’end’, duration: 6.0 });
}
new PeriodicalExecuter(scroll, 30);
</script>
Everything works just fine. Well, everything except the frequency of PeriodicalExecuter. The docs on PeriodicalExecuter says the time (30 in this case) is in seconds. The animation in this case takes just 18s to fire. The missing time (12 seconds) is the sum of the durations of the effects that make up the animation.
This is a a very simple animation, but I do not see why it will not wait the exact time before firing.
Any ideas?
TIA
Umm.. what’s the problem? just add that 12s to the 30s and you have that 30s period?
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
-
MODX Staff
- 12,272 Posts
Maybe increase it to 42 seconds?
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
ok, I did not think this one thru before posting. The frequency is the time in between the firing of PeriodicalExecuter and that should include durations (if specified) in the effects.
Case closed.