Board Logo

slider function parametrization
Stev-O - 4/19/2007 at 07:17 PM

I have modified slider.js adding a function which prepares the 2 records needed to create a new slider: this function receives some parameters (15)
u can use it in your html page simply calling function & passing parameters.

here's the code: it must be appended to original slider.js script:


// sliderBar function realized by Guia -
// adapted & optimized by stev-o - parametrization added
function sliderBar(vert, see, cWidth, cHeight, slWidth, slHeight, pLeft, pTop, pLength, namevar, minValue, maxValue, initValue, step, oldValue) { //prepare main records for a new slider
var sliderImage = 'SlidGrad2.gif'; //slider image
var cursorImage = 'SliderGray.gif'; //cursor image
var A_TPL = {
'b_vertical' : vert, //orientation: vertical or not (horizontal)
'b_watch': see, //visible or not (hidden)
'n_controlWidth': cWidth, //control width
'n_controlHeight': cHeight, //control height
'n_sliderWidth': slWidth, //slider width
'n_sliderHeight': slHeight, //slider height
'n_pathLeft' : pLeft, //path horiz offset
'n_pathTop' : pTop, //path vert offset
'n_pathLength' : pLength, //path lenght
's_imgControl': sliderImage , //slider image
's_imgSlider': cursorImage, //cursor image
'n_zIndex': 1
var A_INIT1 = {
's_form' : 0,
's_name': namevar, //variable name
'n_minValue' : minValue, //min(bar)
'n_maxValue' : maxValue, //max(bar)
'n_value' : initValue, //initial cursor posit & value
'n_step' : step //cursor step
oldval = oldValue; //save original value obtained from CGI GET method
new slider(A_INIT1, A_TPL); //create the new slider with given specs
return true;

Back to forum: