Basic Slider
1. Change the Slider Text in the GGB file

• Click and drag the green point on the slider from 0° to 360°.

  The degree sign on the slider is JUST text (T1). You can right-click and select Edit to change it. All text needs to go between the double quotes at left or right.  Use the number t in your definitions.


2. Change the Properties of the Slider in the GGB file

• Click and drag the blue point left of the slider to move the slider.

In the Algebra Window:

• Right-click on zsLength, select Redefine to change the length.

• Right-click and redefine zsRLeft to change the left limit.

• Right-click and redefine zsRRight to change the right limit.

On the GeoGebra command menu: use File -> Save to save your changes to a ggb file with the filename of your choice!


3. Let the User Input the Slider Value from HTML file

Try it yourself first!

• Pick an angle between 0° and 360°.

• In the box at left box, type in the value (no degree sign!) .
• Then click on the Set Angle button.  

   

The code!

• The code is on this page (index.html). There are three parts.

1. One is the <script> code for the function setCoords - it is and goes right after the <body> tag.

2. The GeoGebra applet loader: code="geogebra.GeoGebraApplet" . This code needs to go between: <applet code="geogebra.GeoGebraApplet" and codebase= (everything in purple with blanks on both sides).

3. The code to set the value is: setCoords('Zs_P',
(setXfield.value- document.ggbApplet.getValue('zsRLeft'))/ document.ggbApplet.getValue('zsScale')+ document.ggbApplet.getXcoord('Zs_1'), document.ggbApplet.getYcoord('Zs_1'))


-It just looks complicated - but it is just "scaling the point " from the left limit and then placing it on the slider...
It sets the coordinates of the point Zs_P on the slider.
To calculate the x-coordinate, it takes the input value and subtracts the Left limit and divides this result by Scale of the slider and adds the x-coordinate of the left point Zs_1 of the slider (see definition zst); the y-coordinate is just the y-coordinate of left point Zs_1.


To see more about javascript and css files with GeoGebra go to Lessons 6 and 7.

                     

Sorry, the GeoGebra Applet could not be started. Please make sure that Java 1.4.2 (or later) is installed and activated. (click here to install Java now)

      LFS with idea for pseudo-slider by Zen Biker Maniac.            Created with GeoGebra