I have a Foundation 6 Slider on an html page I use to setup a device parameters. On page load, I read the parameters from an xml file and I set the page accordingly.
Regarding the slider, I modify the input number which is connected via aria-contro
l to the slider. The problem is that the slider does not update. How can I update the slider?
There the html:
<div class="row">
<div class="small-4 large-4 columns">
<label>Audio Volume</label>
</div>
<div class="small-6 large-6 columns">
<div class="slider" id="slidervol" data-slider data-end="100" display_selector: "#slidervol">
<span class="slider-handle" data-slider-handle role="slider" tabindex="1" aria-controls="sliderVolOutput"></span>
<span class="slider-fill" data-slider-fill></span>
</div>
</div>
<div class="small-2 large-2 columns">
<input name="AudioVolTxtbox" type="number" style="width: 4em;" tabindex="2" id="sliderVolOutput">
</div>
</div>
and here the javascript I use to update the form on load:
function writeDeviceConfForm(xmldoc) {
var vartxt;
var element;
vartxt = xmldoc.getElementsByTagName("AudioVolume")[0].firstChild.nodeValue;
document.DeviceConfig.AudioVolTxtbox.value = vartxt; //input box is correctly updated
...
$('#slidervol').val(33); //this does not work (do nothing)
$('#slidervol').foundation('slider', 'set_value', 33); //this does not work (error: slider is not an accepted parameter)
}