loopj / jquery-simple-slider

Unobtrusive numerical slider plugin for jQuery
194 stars 113 forks source link

Initialise settings on dynamically loaded slider #38

Open shahzain-blur opened 11 years ago

shahzain-blur commented 11 years ago

Hi,

You haven't got any documentation stating how to initialise the slider on a dynamically loaded element. What are the properties that I can use and how are they called?

I have one setup like this:

               $("#sliders").append('<input id="'+dataArray[i].props.id+'" type="text" />');
                $("#"+dataArray[i].props.id).simpleSlider({
                    range: '1,100',
                    step: "0.1"
                });

and it doesn't work.

shahzain-blur commented 11 years ago

I found the problem. For those reading, the solution is:

$("#"+dataArray[i].props.id).simpleSlider({
                range: [1,100],
                step: 1
            });

The step 0.1 is apparently too small to be picked up.

paulmatthews commented 10 years ago

Thank you! I started to think I was going crazy and just missing the documentation somewhere.