Friday, 15 January 2010

nouislider - No Ui Slider - initialize with jquery.data() method -



nouislider - No Ui Slider - initialize with jquery.data() method -

<!-- slider container --> <div class="slidercontainer"> <!-- no ui slider slider div --> <div class="slider" data-start="100" data-min="0" data-max="3000"> </div> <-- hidden input should bond sliders value --> <input type="hidden" class="sliderinput" name="stuff" value="0"> </div> $(function(){ $('.slider').nouislider({ start: [$(this).data(" start ")], range: { 'min': $(this).data(" min "), 'max': $(this).data(" max ") } });

i using nouislider.js plugin form building. since there more 1 slider in form wanted more of dynamic way create them.

since calling $('.slider') returns array of html .slider elements, thought utilize $(this) identifier doesnt seem work, if seek : $(.slider)[0].data("max"); wont work.

i thinking of trying loop through array, starting think perhaps don't understand how data() function works..

jquery nouislider

No comments:

Post a Comment