See Spirograph example.
In this example, a slider representing variable "t" is animated. The "mode" of animation (whether animation is looped forward, backward, or oscillating) can only be set in the GeoGebra program and cannot be modified with JavaScript.
<form name="myForm">
<input value="Play/Pause" onclick="PlayPause()" type="button">
Speed: <input type="text" name="spd" size=2 value="1"> (1 = normal speed)
</form>
<script type="text/javascript">
function PlayPause() {
var applet = document.ggbApplet;
var speed = document.myForm.spd.value;
applet.setAnimating("t", true);
applet.setAnimationSpeed("t", speed); // repeat these lines for all objects to be animated
if (applet.isAnimationRunning()) {
applet.stopAnimation();
}
else {
applet.startAnimation();
}
}
</script>
Comments (0)
You don't have permission to comment on this page.