I have a page where I add a bunch of sliders via an Ajax call. I set the sliders settings by passing the options after they are inserted into the page. I then bind the sliders to the change event and it never gets called. Any ideas?
// add dynamic content
$("#weightsdiv").html(sliderContent);
// initialize sliders with settings
$(".sliderctl").simpleSlider({ range: '[1,100]', theme: 'volume', highlight: 'true', step: 1 });
// bind the onchange event
$(".sliderctl").on("slider:changed", function (event, data) {
console.log("I have changed for the best!");
var id = $(event.target).data("id");
$("#" + id).html(data.value.toFixed(0) + "%");
});
I have a page where I add a bunch of sliders via an Ajax call. I set the sliders settings by passing the options after they are inserted into the page. I then bind the sliders to the change event and it never gets called. Any ideas?