Anyone who can write an APL function should be able to host it on the web.™
Rendered webpage |
APL code |
The master slider sets the allowed range for the slave slider.
:Class jqSliderAdvanced : MiPageSample
⍝ Control:: _JQ.jqSlider
⍝ Description:: Using one slider to set the bounds of another
∇ Compose;min;max;avg
:Access Public
(min max)←20 40
avg←0.5×min+max
Add _.p'The master slider sets the allowed range for the slave slider.'
'#slave'(Add _.h3'Slave Slider: ').Add _.span avg
('#Slave' 'style="width: 50%;"'Add _.jqSlider min max avg).On'slidechange' 'OnSlave'('newval' 'option' 'value')
'#min' '' '#max'(Add _.h3'Master Slider: ').Add¨(_.span min)'– '(_.span max)
('#Master'Add _.jqSlider 0 100,min,max).On'slidechange' 'OnMaster'('newval' 'option' 'values')
∇
∇ r←OnSlave
:Access Public
r←'#slave'Replace⍕Get'newval'
∇
∇ r←OnMaster;min;max
:Access Public
(min max)←⍕¨Get'newval'
r←Execute'$( "#Slave" ).slider( "option", "min", ',min,' );$( "#Slave" ).slider( "option", "max", ',max,' );'
r,←('#min'Replace min),('#max'Replace max)
∇
:EndClass