Jquery UI slider ... create sliders dynamically (fiddle inside)


I am using a jquery ui slider on a website, and the thing is there can be multiple sliders with the same classname on the page, they are added dynamically. If I have two sliders on the page, dragging the handle of one changes the value of both. Does anyone know how I could edit the code below so dragging the handle only affects the one? (I am a js/jquery beginner still)

FIDDLE: http://jsfiddle.net/0Lqw0bgx/53/

You will need to either have different class names or reference unique ids

Do you know if this would be possible to do dynamically?

possible, but I don’t know how, sorry. I would start looking at this - they are creating inputs with dynamically assigned ids

or allow for a new div per slider and reference the div id…this should help also

and 1 more…this looks nice, clean and simple

FIDDLE: http://jsfiddle.net/0Lqw0bgx/53/

This topic is now closed. New replies are no longer allowed.

Conversation continued at