Dependent sliders with different speeds
Description of example
Move the sliders and watch how the other sliders react with different speeds.
Currently the speeds of the sliders are:
- a is1
- b is 0.5
- c is 2
- d is -1
How to use it
- Copy the whole code from my property Script ->
Global JavaScript
tab into your applet'sGlobal JavaScript
tab. - Put your sliders' names into the array
names_of_sliders
in theggbOnInit
function of the Global JavaScript property tab. - Put your sliders' speeds into the array
speeds
in the
ggbOnInit
function of the Global JavaScript property tab. - Add the line
update("name");
wherename
is this slider's name to the Scripting's Update property of each of your sliders.
How it works
To see how this applet works, check the JavaScript of the elements.
At the start of the applet a JS object
sliders
is created, which represents all sliders in JS.
If you want to modify the code for your own applet, you have to change the Global JavaScript Code at two locations, that you can find at the beginning of the ggbOnInit
function.
- The array
names_of_sliders
has the names of your sliders. - The array
speeds
has the respective speeds, in the same order as the names. Every name needs exactly one speed for it at the same position.