set values for multiple nouislider in meteor -
how set multiple instances of nouislider in meteor?
i have initialed multiple sliders on page codes in this . set value of sliders synchronized collection, able initialized value collection in "start" option.
i've been trying calling function on 'slide' event. in function find no way select sliders, or use .val().
var updatesliders=function(){ var slider=$(".sliderrr"); console.log(slider); slider.each(function(){ console.log($(this).val()); }) };
i base answer on wrote on github
<div class="slider-container"> <div class="sliderrr"></div> </div>
and
var slider=$(".sliderrr"); slider.each(function(){ console.log("value:",$(this).val()); })
the problem calling 'each' on sliderrr instead of slider-container.
template.body.rendered = function () { //init slider this.$('.sliderrr').nouislider({ start: 5, connect: "lower", step: 0, format: wnumb({ decimals: 0, }), range: { 'min': 0, 'max': 30 } }); //this part changed var sliderino = this.$('.slider-container'); sliderino.children('.sliderrr').each(function() { console.log($(this).val()); }); };
Comments
Post a Comment