Hi!

I have dynamically made multiple sliders with script.aculo.us. But i cant 
figure out how to refer to the individual slider id or name in the onSlide 
and onChange function. Here is my code:

for (var n=17; n>0; n--) {
                        var newSlider = document.createElement('div');
                        var sliderIdName = 'slide'+n;
                        newSlider.setAttribute('id',sliderIdName);
                        newSlider.className = "slider";
                        slider_div.appendChild(newSlider);

                        var nd = document.createElement('div');
                        nd.className = "handle";
                        newSlider.appendChild(nd);

                        (function() {
                            var time_slider = $(sliderIdName);
                            new Control.Slider(time_slider.down('.handle'), 
time_slider, {
                                range: $R(0, 30),
                                sliderValue: 0,
                                increment: 12,
                                values: arr,
                                //alignY: -5,
                                onSlide: function(value) {
                                    //something
                                    
                                    
document.getElementById("slider_name_text_X").innerHTML = sliderIdName + 
"-" + value + "<br>";
                                },
                                onChange: function(value) { 
                                    //something
                                }
                            });
                        })();
                    }

So im have a text element ("slider_name_text_X") next to every slider (X) 
telling the slider value. So i want all of these text elements to be 
connected to each individual slider. I hope u understand my problem and can 
help, that would be appreciated very much.

Thx anyway,
BR Kristian :)

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prototype-scriptaculous+unsubscr...@googlegroups.com.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
Visit this group at http://groups.google.com/group/prototype-scriptaculous.
For more options, visit https://groups.google.com/d/optout.

Reply via email to