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 JavaScripttab into your applet'sGlobal JavaScripttab. - Put your sliders' names into the array
names_of_slidersin theggbOnInitfunction of the Global JavaScript property tab. - Put your sliders' speeds into the array
speedsin theggbOnInitfunction of the Global JavaScript property tab. - Add the line
update("name");wherenameis 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_slidershas the names of your sliders. - The array
speedshas the respective speeds, in the same order as the names. Every name needs exactly one speed for it at the same position.